Dieuz Posted January 25, 2010 Share Posted January 25, 2010 (edited) How can I terminate a while loop using a different button? $Stop = False ;Gui Here While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 Start() Case $msg = $Button2 Stop() EndSelect WEnd Func Start() While $Stop = false ; Do stuff Wend EndFunc Func Stop() $Stop = true EndFunc Thanks, Dieuz Edited January 25, 2010 by Dieuz Link to comment Share on other sites More sharing options...
Zedna Posted January 25, 2010 Share Posted January 25, 2010 ;Gui Here While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 Start() EndSelect WEnd Func Start() While 1 If GUIGetMsg() = $Button2 Then ExitLoop ; Do stuff Wend EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
kaotkbliss Posted January 25, 2010 Share Posted January 25, 2010 try ExitLoop [level] Parameters level [optional] The number of loop levels to exit from. The default is 1 (meaning the current loop). Remarks A negative level or zero value has no effect. ExitLoop will break out of a While, Do or For loop. ExitLoop is useful when you would otherwise need to perform error checking in both the loop-test and the loop-body. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now