Continue a While/Do/For loop.
ContinueLoop [level]
ContinueLoop will continue execution of the loop at the expression testing statement (that is the While, Until or Next statement).
A negative level or zero value has no effect.
Even though any program that uses ContinueLoop can be rewritten using If-ElseIf-EndIf statements, ContinueLoop can make long scripts easier to understand.
Be careful with While/Do loops; you can create infinite loops by using ContinueLoop incorrectly.
#include <MsgBoxConstants.au3>
_Example()
Func _Example()
; Display all the numbers for 1 to 10 but skip displaying 7.
For $i= 1To 10
If $i= 7Then
ContinueLoop ; Skip displaying the message box when $i is equal to 7.
EndIf
MsgBox ($MB_SYSTEMMODAL,"","The value of $i is: "&$i)
Next
EndFunc ;==>_Example
_Example()
Func _Example()
For $o= 1To 3; "outer loop"
For $i= 1To 10; "inner loop"
If $i= 1Then ConsoleWrite (@CRLF )
If $o= 1And $i= 3Then ContinueLoop 2; if "outer loop" is in first step and "inner loop" is in 3 step, skip "outer loop" to next step
If $o= 2And $i= 5Then ContinueLoop 2; if "outer loop" is in second step and "inner loop" is in 5 step, skip "outer loop" to next step
If $i= 7Then ContinueLoop ; if "inner loop" is in 7 step, skip "inner loop" to next step
ConsoleWrite (" The value of $o="&$o&" $i="&$i&@CRLF )
Next
Next
EndFunc ;==>_Example