View Single Post
Old 03-06-2018, 02:15 PM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,636
Hi bighalo,

As far as solving the problem of unexpected results ...

You've only provided a snippet of code and so I really do not have context for the issue, but isn't it conceivable nIndex might ever not be equal to 1?

If that's the case, exit sub is not going to get called (at least in that loop).

You might temporarily add MsgBox statements in the code at strategic points to try to verify the data:

sub main()
MsgBox "Entering Main()"

  nIndex = objTab.Screen.WaitForStrings(g_vWaitFors)
  MsgBox "nIndex: " & nIndex
  if nIndex = 1 then
    <do something>
    MsgBox "About to exit Main() subroutine"
    exit sub
  end if

end sub

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote