asgarcymed Posted October 10, 2007 Share Posted October 10, 2007 How to offer the possibility to repeat the whole script code's execution without the GoTo instruction? If "GoTo" instruction was available, I could do: [Pseudo-code]: Begin/Start (... main-code ...) Repeat? (If "Yes" is chosen Then GoTo Begin/Star Else End/Exit) End/Exit Do I have to repeat (copy-paste) all main-code inside a Loop Statement (such as Do...Until)? [Pseudo-code]: Begin/Start (... main-code ...) Do (... main-code repeated ...) Until Repeat? = "No" End/Exit MLMK - my blogging craziness... Link to comment Share on other sites More sharing options...
DW1 Posted October 10, 2007 Share Posted October 10, 2007 (edited) You Can just $switch = 0 Do ;~ (... main-code ...) Until $switch = 1 Exit EDIT: Then when you want to exit just make $switch = 1 Edited October 10, 2007 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
weaponx Posted October 10, 2007 Share Posted October 10, 2007 (edited) $result = 0 Do ;Some code $result = MsgBox(1,"","Exit loop?") Until $result = 1 Edited October 10, 2007 by weaponx Link to comment Share on other sites More sharing options...
aslani Posted October 10, 2007 Share Posted October 10, 2007 I would do something like this; While 1 ...process script... $userinput = MsgBox(4, "", "Repeat?") If $userinput = 7 Then ExitLoop WEnd [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
asgarcymed Posted October 10, 2007 Author Share Posted October 10, 2007 Thank you! MLMK - my blogging craziness... 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