If UBound(TestCheck) >= 0 Then
' You get the idea
Normally, VB is a 1-based array language, but the filter command is unique and returns a zero-based array. This screws with a lot of the VB functions.
One function that will always work is UBound.
With the Filter command, it will return -1 if it is an empty array (Such as no results from the filter command) or >=0 when it returns something.
Additionally, it's not just TestCheck(0) that carries the string. If they all contained "failure" then all of them would carry it, and not just 0. You should put a loop in there based on the UBound value.
If TestCheck(0) <> EMPTY then
MsgBox "Found!, '" & TestCheck(0) & "' carries the string."
MsgBox "Lost!, NO " & FindText & " whatsoever."
Now if TestRun(4) = "Need help. Found success" then TestCheck(0) should return an Empty array as per QTP's VB scripting help. But it doesn't. Neither does it return NULL. I tried ISEMPTY, ISNULL. I tried re-assigning the TestCheck(0) to another variable. The problem is that TestCheck(0) is simply not recognized when the string isnt found. I cant change the parameter to False because I need the substring that carries the word "failure" if it exists.
I know I can use loops and there's a number of other ways to do this, but can anyone figure out if the filter command can be made to work when the string is not found?
(I'm hiring Software Development Engineers in Test in Seattle, WA)