Jump to content

Recommended Posts

Posted

I have a loop that I need to run until the a ($stop) button is pressed. But if i use

if $stop then ExitLoop

Then it just ends the loop when that command is hit.

Can someone help me out please?

do a hotKeySet at the start of your script. should look something like this:

HotKeySet( "{ESC}" , "Terminate")

Func Terminate ()

Exit 0

EndFunc

Posted (edited)

Hmm..

Thanks for your guys' help.

I cant get the Dim to work..

Dim $stop = False

...

...

If $stop1 = True Then Exitloop

That seems to just make the loop stop when it hits the "If $stop1 = True Then Exitloop".

Thanks tgarr for the suggestion, but I considered this and I didn't like the idea of the hotkeys. Thanks though.

Edited by houseonfire
Posted (edited)

Add

MsgBox(0,"",$stop)
right before the if statement to verify that $stop is really false at that point.

It might also be an issue with it being a string "True". Try switching it to:

If $stop = "True" Then Exitloop
Edited by Prab

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
×
×
  • Create New...