Jump to content

next


Recommended Posts

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")
Link to comment
Share on other sites

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

:mellow:

Edited 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

  • 3 weeks later...

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

:)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...