Jump to content

Help with while loop


Go to solution Solved by Bert,

Recommended Posts

I think my DO, UNTIL's are causing me issues here.  But I cannot figure it out.

The idea here is to watch for one of 3 windows...  find it...do stuff, wait for it to disappear, then start over

While 1

Do
   Sleep (250)
   Until  WinActive ("Untitled - Notepad", "Window1") or  WinActive ("Untitled - Notepad", "Window2") or  WinActive ("Untitled - Notepad", "Window1")



If WinActive ("Untitled - Notepad", "Window1") Then
   MsgBox (0, "Window1", "Found")
   Do
      Sleep (250)
   Until WinActive ("Untitled - Notepad", "Window1") = 0
   ContinueLoop ; Start while loop over





If WinActive ("Untitled - Notepad", "Window2") Then
   MsgBox (0, "Window1", "Found")
   Do
      Sleep (250)
   Until WinActive ("Untitled - Notepad", "Window2") = 0
    ContinueLoop ; Start while loop over


If WinActive ("Untitled - Notepad", "Window3") Then
   MsgBox (0, "Window1", "Found")
   Do
      Sleep (250)
   Until WinActive ("Untitled - Notepad", "Window3") = 0
    ContinueLoop ; Start while loop over

  WEnd
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...