Jump to content

STopping a loop while its runnning


 Share

Recommended Posts

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

Link to comment
Share on other sites

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
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...