Sign in to follow this  
Followers 0
Mellon

Until A or B

4 posts in this topic

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?

Share this post


Link to post
Share on other sites



Why didn't you try first?

Your code is valid syntax.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0