Jump to content

Restarting a While Loop (problem solved)


Nevin
 Share

Recommended Posts

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
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...