jimmyjmmy Posted November 8, 2008 Posted November 8, 2008 Hi, What must I do so that if the regexp match, go to the next loop :- while 1 If (StringRegExp ($line,"^\s+$")) Then ; go to the next loop Else msgbox(0,"", "whatever") WEnd
Valuater Posted November 8, 2008 Posted November 8, 2008 While 1 If (StringRegExp($line, "^\s+$")) Then ExitLoop Else MsgBox(0, "", "whatever") EndIf WEnd 8)
jimmyjmmy Posted November 8, 2008 Author Posted November 8, 2008 While 1 If (StringRegExp($line, "^\s+$")) Then ExitLoop Else MsgBox(0, "", "whatever") EndIf WEnd 8)Thanks but what I want is if the regex match, iterate the next while loop, I do not wish to exit the loop.
Malkey Posted November 8, 2008 Posted November 8, 2008 Thanks but what I want is if the regex match, iterate the next while loop, I do not wish to exit the loop.Just in case you did not want to exit the second loop and wanted to enter the next while loop, I added the third loop. If you do not wish to exit a loop and enter another loop, the loops have to be nested. While 1 ;First Loop If StringRegExp($line, "^\s+$") Then While 1 ; Second Loop MsgBox(0,"","Did not exit first loop, entered next loop") If StringRegExp($line, "Expression") Then While 1 ; Third Loop MsgBox(0,"","Did not exit second loop, entered third loop") WEnd ; Third Loop Else MsgBox(0, "", "Still in second loop") EndIf WEnd ; Second Loop Else MsgBox(0, "", "Still in first loop") EndIf WEnd ;First Loop ; OR StringRegExp(StringRegExp($line, "^\s+$"), "Expression")
PsaltyDS Posted November 8, 2008 Posted November 8, 2008 (edited) Hi, What must I do so that if the regexp match, go to the next loop :- while 1 If (StringRegExp ($line,"^\s+$")) Then ; go to the next loop Else msgbox(0,"", "whatever") WEnd Perhaps all you meant was ContinueLoop? That will end the current pass through the loop and return to the top of the loop: While 1 If (StringRegExp ($line,"^\s+$")) Then ContinueLoop Else msgbox(0,"", "whatever") EndIf WEnd Edited November 8, 2008 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
jimmyjmmy Posted November 29, 2008 Author Posted November 29, 2008 Thanks valuater, malkey and PsaltyDs. Yes, What I am looking for is ContinueLoop. Thanks Perhaps all you meant was ContinueLoop? That will end the current pass through the loop and return to the top of the loop: While 1 If (StringRegExp ($line,"^\s+$")) Then ContinueLoop Else msgbox(0,"", "whatever") EndIf WEnd
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