Sign in to follow this  
Followers 0
trashy

If then ?

3 posts in this topic

#1 ·  Posted (edited)

I have 5 checkboxes in total. If $T5Checkbox3 is checked how to continue with the rest of the If statements.

If it's unchecked I have another set to run.

Edit: script is 5 tabs, 600 lines and growing. this is part of Func _Tab_5

Case $T5Button3
    If GUICtrlRead($T5Input1) = "" Then
        MsgBox(0, "Empty.....", "No Drive Selected!")
        Return
    EndIf
    If GUICtrlRead($T5Checkbox3) = $Gui_Checked Then
;>>>>>>>>>>>>>>>If $T5Checkbox3 is checked then continue with following If statements If unchecked I have a different set of If statments to run>>>>>>>>>>>>>>>>>>>>>>>>>
        If GUICtrlRead($T5Checkbox1) = $GUI_CHECKED And GUICtrlRead($T5Checkbox2) = $GUI_CHECKED Then
            RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & ' /Name:"' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1) & ' /CheckIntegrity /Verify', "")
        ElseIf GUICtrlRead($T5Checkbox1) = $GUI_CHECKED Then
            RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & ' /Name:"' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1) & ' /CheckIntegrity', "")
        ElseIf GUICtrlRead($T5Checkbox2) = $GUI_CHECKED Then
            RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & ' /Name:"' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1) & ' /Verify', "")
        Else
            RunWait(@ComSpec & ' /k "' & @ScriptDir & '\Dism.exe /Capture-Image /ImageFile:"' & GUICtrlRead($T5Input2) & '" /CaptureDir:' & GUICtrlRead($T5Input1) & '" /Name:' & GUICtrlRead($T5Input4) & ' /description:' & GUICtrlRead($T5Input5) & ' /Compress:' & GUICtrlRead($T5ComboBox1), "")
        EndIf
Case $T5Button4
Edited by trashy

Share this post


Link to post
Share on other sites



Another DUHHHH moment. Just add GUICtrlRead($T5Checkbox3) = $Gui_Checked And,

to the beginning of each If statement.


Share this post


Link to post
Share on other sites

Your sample is syntactically incorrect.  And there is no need to add that additional Boolean condition to the inner If statements, since you would only be in there if checked...no point to check twice.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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  
Followers 0