Jump to content
Sign in to follow this  
DigDeep

Skip further actions without exit GUI

Recommended Posts

DigDeep

Hi,

I am stuck at a stage and would need some help here.

Everything is good except the part:

Select
    Case FileExists("found something which should not be here")
;        (Skip the below process. Butdo not exit Example GUI)
EndSelect

If the above part runs then I want any further actions inside the Button 2 to be skipped for (PartB, Part C and Part D) but should not exit the complete GUI

I cannot use the "Exit" here as it exits complete GUI.

#NoTrayIcon
#RequireAdmin
#include<process.au3>
#include <Date.au3>
#include <File.au3>
#include <IE.au3>
#include <Array.au3>
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("                Example", 352, 117, -1, -1, $GUI_SS_DEFAULT_GUI)
$Button1 = GUICtrlCreateButton("Button 1", 32, 48, 131, 25)
$Button2 = GUICtrlCreateButton("Button 2", 192, 48, 131, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            $nMsg = MsgBox(68, "Example", "Do you want to exit?", $Form1)
                Exit

        Case $nMsg = $Button1 ; Install Button
; Perform $Button1 Actions

        Case $nMsg = $Button2 ; Repair Button
; Perform $Button2 Actions

;    1. PartA script

            Select
                Case FileExists("found something which should not be here")
            ;        (Skip the below process. Butdo not exit Example GUI)
            EndSelect

;    2. Part B Script

;     3. Part C script

;     4. Part D script

    EndSelect
WEnd
Edited by sunshinesmile84

Share this post


Link to post
Share on other sites
mikell

ContinueLoop   :)

Edit

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
                Exit
        Case $nMsg = $Button1      
               ;....
        Case $nMsg = $Button2 
              If FileExists("should not be here") Then ContinueLoop    ; restart execution of the loop at the expression testing statement (While)
              ; If not then do something  

    EndSelect
WEnd
Edited by mikell

Share this post


Link to post
Share on other sites
caramen

Exemple of Logic Help :

You share your part A Into 2 function in teh while.

; PART A SCRIPT :

While (1)
         Func AlloA ()
                 Select
                      Case FileExists("found something which should not be here")
                      ;        (Skip the below process. Butdo not exit Example GUI)
                                AlloB ()
                 EndSelect
         EndFunc
         
         Func AlloB ()
                   ExitLoop
         EndFunc
WEnd

Tips :

-Anything under Case line is do until the Next case or the EndSelect

-If you do a loop you can exit loop anywhere by using ExitLoop

- You can even use loop only to do multiple case and ignore a part of your script

If Condition 1 then 
   ExitLoop
EndIf

Hf

Edited by caramen

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  

×