Sign in to follow this  
Followers 0
D8taSlay3r

Multiple check boxes and variables problem

5 posts in this topic

I am trying to write a GUI front end to execute commands based on a combination of checkboxes. The basic flow would be the user picks an action from the list, then checks which machines to run the action against and then which pod's the machines belong to. The user should be able to select multiple machines and multiple pods for a single action. It's far from finished but I'm running into problems early on.

How can I go sequentially through the variables that represent the checkboxes to see if they are checked, run a command if they are, and then go to the next without having to write a separate "IF" section for each variable? I want the script to start at POD01, check to see which machines are checked, run commands, and then do the same thing for all the other POD's that are checked.

I'm new to this and it's just not coming to me. There has got to be an easier way to do this than the way I'm writing it at the moment. Can anybody help?

I just wrote it to go through PODS 1 and 2 just for example purposes.

#include <GUIConstants.au3>

GUICreate("Controller")  
Opt("GUICoordMode",2)
$widthCell=125


GUICtrlCreateLabel ("Actions",  10, 30, $widthCell) ; 
$MenuAction =   GUICtrlCreateCombo ("", -1, 0) 
GUICtrlSetData(-1,"Power On|Power Off|Restart|","") 

GUICtrlCreateLabel ("Machines",  -1, 30, $widthCell) ; 
$CheckVM01 = GUICtrlCreateCheckbox ("PCA", -1, 0)
$CheckVM02 = GUICtrlCreateCheckbox ("PCB", -1, 0)
$CheckVM03 = GUICtrlCreateCheckbox ("PCC", -1, 0)
$CheckVM04 = GUICtrlCreateCheckbox ("PCD", -1, 0)

GUICtrlCreateLabel ("Shared Machines",  -1, 30, $widthCell) ; 
$CheckVM05 = GUICtrlCreateCheckbox ("SVR01", -1, 0)
$CheckVM06 = GUICtrlCreateCheckbox ("SVR02", -1, 0)

$Button_1 = GUICtrlCreateButton ("Execute",  -1, 10, 100)
$Button_2 = GUICtrlCreateButton ( "Exit",  0, -1)


GUISetCoord(20,82)
GUICtrlCreateLabel ("PODS", 100, 0, $widthCell) ; 
$CheckPOD01 = GUICtrlCreateCheckbox ("POD01", -1, 0)
$CheckPOD02 = GUICtrlCreateCheckbox ("POD02", -1, 0)
$CheckPOD03 = GUICtrlCreateCheckbox ("POD03", -1, 0)
$CheckPOD04 = GUICtrlCreateCheckbox ("POD04", -1, 0)
$CheckPOD05 = GUICtrlCreateCheckbox ("POD05", -1, 0)
$CheckPOD06 = GUICtrlCreateCheckbox ("POD06", -1, 0)
$CheckPOD07 = GUICtrlCreateCheckbox ("POD07", -1, 0)
$CheckPOD08 = GUICtrlCreateCheckbox ("POD08", -1, 0)
$CheckPOD09 = GUICtrlCreateCheckbox ("POD09", -1, 0)
$CheckPOD10 = GUICtrlCreateCheckbox ("POD10", -1, 0)


GUISetState ()       

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    If $msg = $Button_1 Then
        $Actionstate  = GUICtrlRead($MenuAction) ; return the state of the menu item        
        
        ;Run the action against the shared machines first
        If BitAND(GUICtrlRead($CheckVM05), $GUI_CHECKED) = $GUI_CHECKED Then
            ;put command to run here
        ElseIf BitAND(GUICtrlRead($CheckVM06), $GUI_CHECKED) = $GUI_CHECKED Then
            ;put command to run here
        EndIf
        
        ;Go through PODS to see which are checked
            If BitAND(GUICtrlRead($CheckPOD01), $GUI_CHECKED) = $GUI_CHECKED Then
                $POD = "POD01"
                If BitAND(GUICtrlRead($CheckVM01), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCA"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM)
                EndIf
                If BitAND(GUICtrlRead($CheckVM02), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCB"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If BitAND(GUICtrlRead($CheckVM03), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCC"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If BitAND(GUICtrlRead($CheckVM04), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCD"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
            EndIf
    
            If BitAND(GUICtrlRead($CheckPOD02), $GUI_CHECKED) = $GUI_CHECKED Then
                $POD = "POD02"
                If BitAND(GUICtrlRead($CheckVM01), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCA"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM)
                EndIf
                If BitAND(GUICtrlRead($CheckVM02), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCB"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If BitAND(GUICtrlRead($CheckVM03), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCC"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If BitAND(GUICtrlRead($CheckVM04), $GUI_CHECKED) = $GUI_CHECKED Then
                    $VM = "PCD"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
            EndIf
    
    EndIf
    
    
    If $msg = $Button_2 Then
        Exit
    EndIf

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites



First little optimization:

#include <GUIConstants.au3>

GUICreate("Controller") 
 Opt("GUICoordMode",2)
$widthCell=125


GUICtrlCreateLabel ("Actions",  10, 30, $widthCell) ; 
$MenuAction =    GUICtrlCreateCombo ("", -1, 0) 
GUICtrlSetData(-1,"Power On|Power Off|Restart|","") 

GUICtrlCreateLabel ("Machines",  -1, 30, $widthCell) ; 
$CheckVM01 = GUICtrlCreateCheckbox ("PCA", -1, 0)
$CheckVM02 = GUICtrlCreateCheckbox ("PCB", -1, 0)
$CheckVM03 = GUICtrlCreateCheckbox ("PCC", -1, 0)
$CheckVM04 = GUICtrlCreateCheckbox ("PCD", -1, 0)

GUICtrlCreateLabel ("Shared Machines",  -1, 30, $widthCell) ; 
$CheckVM05 = GUICtrlCreateCheckbox ("SVR01", -1, 0)
$CheckVM06 = GUICtrlCreateCheckbox ("SVR02", -1, 0)

$Button_1 = GUICtrlCreateButton ("Execute",  -1, 10, 100)
$Button_2 = GUICtrlCreateButton ( "Exit",  0, -1)


GUISetCoord(20,82)
GUICtrlCreateLabel ("PODS", 100, 0, $widthCell) ; 
$CheckPOD01 = GUICtrlCreateCheckbox ("POD01", -1, 0)
$CheckPOD02 = GUICtrlCreateCheckbox ("POD02", -1, 0)
$CheckPOD03 = GUICtrlCreateCheckbox ("POD03", -1, 0)
$CheckPOD04 = GUICtrlCreateCheckbox ("POD04", -1, 0)
$CheckPOD05 = GUICtrlCreateCheckbox ("POD05", -1, 0)
$CheckPOD06 = GUICtrlCreateCheckbox ("POD06", -1, 0)
$CheckPOD07 = GUICtrlCreateCheckbox ("POD07", -1, 0)
$CheckPOD08 = GUICtrlCreateCheckbox ("POD08", -1, 0)
$CheckPOD09 = GUICtrlCreateCheckbox ("POD09", -1, 0)
$CheckPOD10 = GUICtrlCreateCheckbox ("POD10", -1, 0)


GUISetState () 
      
; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    If $msg = $Button_1 Then
        $Actionstate  = GUICtrlRead($MenuAction) ; return the state of the menu item 
                       ;Run the action against the shared machines first
        If IsChecked($CheckVM05) Then
            ;put command to run here
        ElseIf IsChecked($CheckVM06) Then
            ;put command to run here
        EndIf
                ;Go through PODS to see which are checked
            If IsChecked($CheckPOD01) Then
                $POD = "POD01"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM)
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
            EndIf
                If IsChecked($CheckPOD02) Then
                $POD = "POD02"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM)
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
            EndIf
        EndIf
            If $msg = $Button_2 Then
        Exit
    EndIf

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Func IsChecked($control)
    Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED
EndFunc

For your checkboxes use array of variables and do loop throug that array.

Inside loop you can read text of chekbox by GUICtrlRead() with advanced=1

Share this post


Link to post
Share on other sites

Thanks for the help. I'll go down that route and see what I come up with.

First little optimization:

#include <GUIConstants.au3>

GUICreate("Controller") 
 Opt("GUICoordMode",2)
$widthCell=125


GUICtrlCreateLabel ("Actions",  10, 30, $widthCell) ; 
$MenuAction =    GUICtrlCreateCombo ("", -1, 0) 
GUICtrlSetData(-1,"Power On|Power Off|Restart|","") 

GUICtrlCreateLabel ("Machines",  -1, 30, $widthCell) ; 
$CheckVM01 = GUICtrlCreateCheckbox ("PCA", -1, 0)
$CheckVM02 = GUICtrlCreateCheckbox ("PCB", -1, 0)
$CheckVM03 = GUICtrlCreateCheckbox ("PCC", -1, 0)
$CheckVM04 = GUICtrlCreateCheckbox ("PCD", -1, 0)

GUICtrlCreateLabel ("Shared Machines",  -1, 30, $widthCell) ; 
$CheckVM05 = GUICtrlCreateCheckbox ("SVR01", -1, 0)
$CheckVM06 = GUICtrlCreateCheckbox ("SVR02", -1, 0)

$Button_1 = GUICtrlCreateButton ("Execute",  -1, 10, 100)
$Button_2 = GUICtrlCreateButton ( "Exit",  0, -1)


GUISetCoord(20,82)
GUICtrlCreateLabel ("PODS", 100, 0, $widthCell) ; 
$CheckPOD01 = GUICtrlCreateCheckbox ("POD01", -1, 0)
$CheckPOD02 = GUICtrlCreateCheckbox ("POD02", -1, 0)
$CheckPOD03 = GUICtrlCreateCheckbox ("POD03", -1, 0)
$CheckPOD04 = GUICtrlCreateCheckbox ("POD04", -1, 0)
$CheckPOD05 = GUICtrlCreateCheckbox ("POD05", -1, 0)
$CheckPOD06 = GUICtrlCreateCheckbox ("POD06", -1, 0)
$CheckPOD07 = GUICtrlCreateCheckbox ("POD07", -1, 0)
$CheckPOD08 = GUICtrlCreateCheckbox ("POD08", -1, 0)
$CheckPOD09 = GUICtrlCreateCheckbox ("POD09", -1, 0)
$CheckPOD10 = GUICtrlCreateCheckbox ("POD10", -1, 0)


GUISetState () 
      
; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    If $msg = $Button_1 Then
        $Actionstate  = GUICtrlRead($MenuAction) ; return the state of the menu item 
                       ;Run the action against the shared machines first
        If IsChecked($CheckVM05) Then
            ;put command to run here
        ElseIf IsChecked($CheckVM06) Then
            ;put command to run here
        EndIf
                ;Go through PODS to see which are checked
            If IsChecked($CheckPOD01) Then
                $POD = "POD01"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM)
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
            EndIf
                If IsChecked($CheckPOD02) Then
                $POD = "POD02"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM)
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    MsgBox( 0, "Target", "The command in this section will target " & $POD & ":" & $VM) 
                EndIf
            EndIf
        EndIf
            If $msg = $Button_2 Then
        Exit
    EndIf

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Func IsChecked($control)
    Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED
EndFunc

For your checkboxes use array of variables and do loop throug that array.

Inside loop you can read text of chekbox by GUICtrlRead() with advanced=1

Share this post


Link to post
Share on other sites

I couldn't figure out how to do the array correctly. I ended up writing the whole thing out the long way. I would really appreciate it if someone could take a look at this and see how it can be optimized/made better. Thanks.

#include <GUIConstants.au3>
#include <Array.au3>

Func IsChecked($control)
    Return BitAND(GUICtrlRead($control), $GUI_CHECKED) = $GUI_CHECKED
EndFunc

;Set variables for commands to run
$CmdVmcontrol = '"C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\apps\vm\vmcontrol.pl" --config viperlconfig.txt --operation '
$CmdSnapshot = '"C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\apps\vm\snapshotmanager.pl" --config viperlconfig.txt --operation revert '

GUICreate("Controller")  ; will create a dialog box that when displayed is centered
Opt("GUICoordMode",2)
$widthCell=125

GUICtrlCreateLabel ("Actions",  10, 30, $widthCell) ; 
$MenuAction =   GUICtrlCreateCombo ("", -1, 0) ; create first item
GUICtrlSetData(-1,"Power On|Power Off|Restart|Revert Snapshot|","") ; add other item snd set a new default

GUICtrlCreateLabel ("Machines",  -1, 30, $widthCell) ; 
$CheckVM01 = GUICtrlCreateCheckbox ("PCA", -1, 0)
$CheckVM02 = GUICtrlCreateCheckbox ("PCB", -1, 0)
$CheckVM03 = GUICtrlCreateCheckbox ("PCC", -1, 0)
$CheckVM04 = GUICtrlCreateCheckbox ("PCD", -1, 0)

GUICtrlCreateLabel ("Shared Machines",  -1, 30, $widthCell) ; 
$CheckVM05 = GUICtrlCreateCheckbox ("PCE", -1, 0)
$CheckVM06 = GUICtrlCreateCheckbox ("PCF", -1, 0)
$Button_1 = GUICtrlCreateButton ("Execute",  -1, 10, 100)
$Button_2 = GUICtrlCreateButton ( "Exit",  0, -1)

GUISetCoord(20,82)
GUICtrlCreateLabel ("PODS", 100, 0, $widthCell) ; 
$CheckPOD01 = GUICtrlCreateCheckbox ("POD01", -1, 0)
$CheckPOD02 = GUICtrlCreateCheckbox ("POD02", -1, 0)
$CheckPOD03 = GUICtrlCreateCheckbox ("POD03", -1, 0)
$CheckPOD04 = GUICtrlCreateCheckbox ("POD04", -1, 0)
$CheckPOD05 = GUICtrlCreateCheckbox ("POD05", -1, 0)
$CheckPOD06 = GUICtrlCreateCheckbox ("POD06", -1, 0)
;$CheckPOD07 = GUICtrlCreateCheckbox ("POD07", -1, 0)
;$CheckPOD08 = GUICtrlCreateCheckbox ("POD08", -1, 0)
;$CheckPOD09 = GUICtrlCreateCheckbox ("POD09", -1, 0)
;$CheckPOD10 = GUICtrlCreateCheckbox ("POD10", -1, 0)

GUISetState ()       

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    If $msg = $Button_1 Then
        $Actionstate  = GUICtrlRead($MenuAction) ; return the state of the menu item        
        If $Actionstate = "" Then
            MsgBox(0,"Error", "You must select an action to be performed")
        ElseIf $Actionstate = "Power On" Then
            $Command = $CmdVmcontrol & "poweron --vmname "
            MsgBox(0, "Action", "Action to be performed is: " & $Actionstate)
        ElseIf $Actionstate = "Power Off" Then
            $Command = $CmdVmcontrol & "poweroff --vmname "
            MsgBox(0, "Action", "Action to be performed is: " & $Actionstate)
        ElseIf $Actionstate = "Restart" Then
            $Command = $CmdVmcontrol & "reboot --vmname "
            MsgBox(0, "Action", "Action to be performed is: " & $Actionstate)
        ElseIf $Actionstate = "Revert Snapshot" Then
            $Command = $CmdSnapshot & "revert --vmname "
            MsgBox(0, "Action", "Action to be performed is: " & $Actionstate)
                EndIf
    ;Run the action against the shared machines first
        If IsChecked($CheckVM05) Then
            Run(@ComSpec & " /c " & "perl.exe " & $Command & "PCE", "C:\path" )
        EndIf
        If IsChecked($CheckVM06) Then
            Run(@ComSpec & " /c " & "perl.exe " & $Command & "PCF", "C:\path" )
        EndIf
        
        ;Go thorugh PODS to see which are checked
            If IsChecked($CheckPOD01) Then
                $POD = "POD01"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
            EndIf
    
            If IsChecked($CheckPOD02) Then
                $POD = "POD02"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
            EndIf
            
            If IsChecked($CheckPOD03) Then
                $POD = "POD03"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
            EndIf

            If IsChecked($CheckPOD04) Then
                $POD = "POD04"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
            EndIf

            If IsChecked($CheckPOD05) Then
                $POD = "POD05"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
            EndIf

            If IsChecked($CheckPOD06) Then
                $POD = "POD06"
                If IsChecked($CheckVM01) Then
                    $VM = "PCA"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM02) Then
                    $VM = "PCB"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM03) Then
                    $VM = "PCC"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
                If IsChecked($CheckVM04) Then
                    $VM = "PCD"
                    Run(@ComSpec & " /c " & "perl.exe " & $Command & $POD & "-" & $VM, "C:\path" )
                EndIf
            EndIf


            
        EndIf
            If $msg = $Button_2 Then
        Exit
    EndIf

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Share this post


Link to post
Share on other sites

I couldn't figure out how to do the array correctly. I ended up writing the whole thing out the long way. I would really appreciate it if someone could take a look at this and see how it can be optimized/made better. Thanks.

Look here

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