Andrejj Posted January 5, 2012 Share Posted January 5, 2012 Hello, currently I have a little problem which I cant solve. I will just post an example which will make it easier to understand what I want to do. While 1 Send("1") Call("_stop") Send("2") exit WEnd Func _stop() Send("ala") EndFunc When I run this Script it writes: 1ala2 But I want to do the following: 1ala1ala1 So afterall I want to call the function _stop and break the current while loop and restart at the first line again or better said at Send("1"). What I have to do? Link to comment Share on other sites More sharing options...
MilesAhead Posted January 5, 2012 Share Posted January 5, 2012 (edited) Why the need for Call()? Also why have an Exit inside the loop? Just use ExitLoop or ContinueLoop. Have the Exit after the loop body. While 1 Send("1") switch Call("_stop") case 1 ContinueLoop case -1 ExitLoop EndSwitch Send("2") WEnd Exit Func _stop() Send("ala") If $SkipReason then Return 1 If $QuitReason then Return -1 Return 0 EndFunc Edited January 5, 2012 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
ACExSPADE Posted February 5, 2017 Share Posted February 5, 2017 Its coming up with 1ala2 because your second send says to send a "2". Also the loop isnt repeating because the exit is exiting the loop before it can repeat. Also if you want it to come out 1ala1ala1 then your loop shouldnt even contain the send ("2") because even if you change it to send ("1") as i stated above ot will say 1ala11ala1... and so on. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 5, 2017 Developers Share Posted February 5, 2017 @ACExSPADE, Welcome to our forums! What made you decide to answer in a thread which is 5 years old as a first post? Jos EmilyLove 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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