Jump to content

Until A or B


 Share

Recommended Posts

After a search and checking the doc I am pretty sure the answer is NO but I thought I would check.

Do
   .....
   .....
   In this event A=8
   In some other event B=2

Until A=8 or B=2

Is it possible to use an "or" in an Do...Until loop as I did above?

Link to comment
Share on other sites

Oh, I did try it. It didn't work as it was written so I assumed it wasn't valid. I look into the code it is supposed to work with.

The answer is yes.

HotKeySet("{INSERT}", "TEST")

While 1
    Sleep(50)
    ToolTip("Press ""Insert"" to test.", @DesktopWidth/2 -100, @DesktopHeight/2 -100)
WEnd

Func TEST()
Do
    $A = Random(1, 10, 1)
    
    $B = Random(1, 10, 1)
Until $A = 8 Or $B = 2

Select
    Case $A = 8
        MsgBox(0, "Hello", "It was A")

    Case $B = 2
        MsgBox(0, "Hello", "It was B")
EndSelect
EndFunc
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...