Jump to content
Sign in to follow this  
jimmyjmmy

next

Recommended Posts

jimmyjmmy

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

Share this post


Link to post
Share on other sites
Malkey

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")

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
jimmyjmmy

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

:)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.