Jump to content
Sign in to follow this  
Nevin

Restarting a While Loop (problem solved)

Recommended Posts

Nevin

Anyone know how to do this? Or perhaps there is another solution. Here's my code..I'll try and downsize it a bit.

While 1;main loop
    
    if 1 Then;condition removed for reproducer
        $DOS = InputBox("Enter data","Enter data::",""," ",-1,120);take in input
        if @error=1 Then; @error=1 means the cancel button was pressed
            MsgBox(48,"Action cancelled","Exiting program")
            ExitLoop;######I would prefer the program go back to the beginning of the loop here instead###
        EndIf
        
    ;below code commented out for reproducer
        
    ;Function called here
                
    ;Select;some functions and whatnot
    ;Case GUICtrlRead($rad1) = $GUI_CHECKED
        ;GUICtrlSetState($rad1,$GUI_UNCHECKED)
        ;function
    ;Case GUICtrlRead($rad2) = $GUI_CHECKED
        ;GUICtrlSetState($rad2,$GUI_UNCHECKED)
        ;function
    ;Case GUICtrlRead($rad3) = $GUI_CHECKED
        ;GUICtrlSetState($rad3,$GUI_UNCHECKED)          
        ;function
    ;EndSelect      
        
    EndIf
        
WEnd

You can run that if you'd like. You see it just keeps running in a loop until canceled. Instead, when testing for @error, I want it to go back to the beginning of the While loop.

Edited by Nevin

Share this post


Link to post
Share on other sites
LarryDalooza

continueloop


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

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  

×