chun914 Posted August 30, 2006 Share Posted August 30, 2006 here's my code while 1 ... for $i = 1 to 10 if $i=3 then continueloop endif next wend what i want is then $i = 3 ... the program will skip to the next while loop in stead of the for loop.. isnt' that i can add a loop level in the continue loop function ? Link to comment Share on other sites More sharing options...
xcal Posted August 30, 2006 Share Posted August 30, 2006 while 1 ... for $i = 1 to 10 if $i=3 then continueloop next wend How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 30, 2006 Share Posted August 30, 2006 (edited) here's my code while 1 ... for $i = 1 to 10 if $i=3 then continueloop endif next wend what i want is then $i = 3 ... the program will skip to the next while loop in stead of the for loop.. isnt' that i can add a loop level in the continue loop function ? The ContinueLoop keyword accepts a parameter for the level of nesting that you want to continue. The following exits the For/Next loop and continues the While/WEnd loop: while 1 _MyFuncOne() for $i = 1 to 10 _MyFuncTwo() if $i=3 then continueloop 2 endif next _MyFuncThree() wend You could just put ExitLoop and get out of the For/Next loop. Then the script would continue by executing _MyFuncThree() next. The difference between this and using ContinueLoop is that _MyFuncThree() will not be executed. On hitting the ContinueLoop 2, the script will continue at While 1 and do _MyFuncOne() next. P.S. Edited to explain difference with ExitLoop. Edited August 30, 2006 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
VeeDub Posted August 30, 2006 Share Posted August 30, 2006 while 1... for $i = 1 to 10 if $i=3 then continueloop nextwendThe continueloop should be exitloopThe exitloop will exit the for/next loop and place you in the while loop Link to comment Share on other sites More sharing options...
xcal Posted August 30, 2006 Share Posted August 30, 2006 Oops, right you are. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
MHz Posted August 30, 2006 Share Posted August 30, 2006 The continueloop should be exitloopThe exitloop will exit the for/next loop and place you in the while loopSo does ContinueLoop 2, but it depends if if you want to continue the loop or restart the loop. Link to comment Share on other sites More sharing options...
chun914 Posted August 31, 2006 Author Share Posted August 31, 2006 yeah...thanks so much 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