Jump to content

Table Help - Add more checkboxes


Recommended Posts

I need to add 10 more ($aApps[0]) checkboxes to this table. Can someone edit this table and reply so they show up?

I tried adding $aApps[24] thru $aApps[32] and I guess I did it wrong, but they did not show up...

I tried a table editor program but it will not run on my computer for whatever reason

Thanks!

#RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

; Declare arrays
Global $aRadio[24]
Global $aApps[24]

; List the path to your scripts
$aApps[0] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\J_Common - HP_Terrell.au3"'
$aApps[1] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Common - WYLIE.au3"'
$aApps[2] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\M_Common - Stonewall.au3"'
$aApps[3] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\Z_Common - CCMFS.au3"'
$aApps[4] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Filer - Public.au3"'
$aApps[5] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_CCW Sales.au3"'
$aApps[6] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Credit.au3"'
$aApps[7] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Cust_Serv.au3"'
$aApps[8] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Design.au3"'
$aApps[9] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Engineering.au3"'
$aApps[10] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_FSR.au3"'
$aApps[11] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_HR.au3"'
$aApps[12] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_IT.au3"'
$aApps[13] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Marketing.au3"'
$aApps[14] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"'
$aApps[15] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"'
$aApps[16] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"'
$aApps[17] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"'
$aApps[18] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"'
$aApps[19] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"'
$aApps[20] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[21] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'
$aApps[22] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - TERRELL.au3"'
$aApps[23] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - WYLIE.au3"'

$hGUI = GUICreate("Vince's Network Drive Script :D", 510, 240, 200, 200)
GUICtrlCreateLabel("Add which drives?", 10, 10, 126, 17)

GUICtrlCreateGroup("", 20, 20, 460, 175)

For $i = 0 To 2
    For $j = 0 To 7
        ; Extract the name of the app from the path
        $sName = StringRegExpReplace($aApps[($i * 8) + $j], "^.*\\|\..*$", "")
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

$hButton1 = GUICtrlCreateButton("Start", 30, 200, 129, 25, 0)
$hButton2 = GUICtrlCreateButton("Select All", 180, 200, 129, 25, 0)
$hButton3 = GUICtrlCreateButton("UnSelect All", 330, 200, 129, 25, 0)

GUISetState() ; You only need this once

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            ; ownage has arrived
            For $i = 0 To 23
                If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) = $GUI_CHECKED Then
                    RunWait($aApps[$i])
                    ConsoleWrite("Running: " & $aApps[$i] & @CRLF) ; testing
                EndIf
            Next
            Exit
        Case $hButton2
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_CHECKED)
            Next
        Case $hButton3
            For $i = 0 To 23
                GUICtrlSetState($aRadio[$i], $GUI_UNCHECKED)
            Next
    EndSwitch
WEnd

 

Edited by JLogan3o13
Link to comment
Share on other sites

  • Moderators

@vincepr0 as I seem to be explaining a lot tonight the AutoIt forum is not a pizza parlor. We operate on the "Teach a man to fish" motto; this is not a place where you put in an order and someone barfs up code for you.

You stated you tried something and you guess you "did it wrong", care to expand on this? How about showing the code where you added the additional 10, and explaining what errors you saw? Help us help you ;)

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I guess I don't understand your method of teaching then... Some people learn from reverse engineering the code given to see how it was done. 

The table itself is not big enough to fit all the check boxes (assumption)

I have tried messing with the numbers and it does make it bigger, but no more than 24 checkboxes appear....

Are you able to help and tell me what I did wrong?

 

$hGUI = GUICreate("Vince's Network Drive Script :D", 510, 240, 200, 200)

GUICtrlCreateLabel("Add which drives?", 10, 10, 126, 17)

GUICtrlCreateGroup("", 20, 20, 460, 175)

 

 

#RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

; Declare arrays
Global $aRadio[34]
Global $aApps[34]

; List the path to your scripts
$aApps[0] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\J_Common - HP_Terrell.au3"'
$aApps[1] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Common - WYLIE.au3"'
$aApps[2] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\M_Common - Stonewall.au3"'
$aApps[3] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\Z_Common - CCMFS.au3"'
$aApps[4] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Filer - Public.au3"'
$aApps[5] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_CCW Sales.au3"'
$aApps[6] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Credit.au3"'
$aApps[7] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Cust_Serv.au3"'
$aApps[8] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Design.au3"'
$aApps[9] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Engineering.au3"'
$aApps[10] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_FSR.au3"'
$aApps[11] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_HR.au3"'
$aApps[12] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_IT.au3"'
$aApps[13] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Marketing.au3"'
$aApps[14] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"'
$aApps[15] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"'
$aApps[16] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"'
$aApps[17] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"'
$aApps[18] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"'
$aApps[19] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"'
$aApps[20] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[21] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'
$aApps[22] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - TERRELL.au3"'
$aApps[23] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - WYLIE.au3"'
$aApps[24] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"'
$aApps[25] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"'
$aApps[26] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"'
$aApps[27] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"'
$aApps[28] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"'
$aApps[29] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"'
$aApps[30] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[31] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'
$aApps[32] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"' 
$aApps[33] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'

$hGUI = GUICreate("Vince's Network Drive Script :D", 510, 240, 200, 200)
GUICtrlCreateLabel("Add which drives?", 10, 10, 126, 17)

GUICtrlCreateGroup("", 20, 20, 460, 175)

For $i = 0 To 2
    For $j = 0 To 7
        ; Extract the name of the app from the path
        $sName = StringRegExpReplace($aApps[($i * 8) + $j], "^.*\\|\..*$", "")
        ; Fill the array with the ControlIDs of the checkboxes
        $aRadio[($i * 8) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
    Next
Next

$hButton1 = GUICtrlCreateButton("Start", 30, 200, 129, 25, 0)
$hButton2 = GUICtrlCreateButton("Select All", 180, 200, 129, 25, 0)
$hButton3 = GUICtrlCreateButton("UnSelect All", 330, 200, 129, 25, 0)

GUISetState() ; You only need this once

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            ; ownage has arrived
            For $i = 0 To 33
                If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) = $GUI_CHECKED Then
                    RunWait($aApps[$i])
                    ConsoleWrite("Running: " & $aApps[$i] & @CRLF) ; testing
                EndIf
            Next
            Exit
        Case $hButton2
            For $i = 0 To 33
                GUICtrlSetState($aRadio[$i], $GUI_CHECKED)
            Next
        Case $hButton3
            For $i = 0 To 33
                GUICtrlSetState($aRadio[$i], $GUI_UNCHECKED)
            Next
    EndSwitch
WEnd
Link to comment
Share on other sites

  • Developers
10 minutes ago, vincepr0 said:

Anything above 24 will not show.

But that makes perfect sense looking at your code...right?
I am wondering why that isn't clear to you as you do 2 for/next loops which create these 3x8 entries in the GUI.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

exactly. you may need another loop to get all of the members represented as radio boxes

#RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Array.au3>

; Declare arrays
Global $aRadio[34]
Global $aApps[34]

; List the path to your scripts
$aApps[0] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\J_Common - HP_Terrell.au3"'
$aApps[1] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Common - WYLIE.au3"'
$aApps[2] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\M_Common - Stonewall.au3"'
$aApps[3] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\Z_Common - CCMFS.au3"'
$aApps[4] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Filer - Public.au3"'
$aApps[5] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_CCW Sales.au3"'
$aApps[6] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Credit.au3"'
$aApps[7] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Cust_Serv.au3"'
$aApps[8] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Design.au3"'
$aApps[9] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Engineering.au3"'
$aApps[10] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_FSR.au3"'
$aApps[11] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_HR.au3"'
$aApps[12] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_IT.au3"'
$aApps[13] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Marketing.au3"'
$aApps[14] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"'
$aApps[15] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"'
$aApps[16] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"'
$aApps[17] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"'
$aApps[18] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"'
$aApps[19] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"'
$aApps[20] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[21] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'
$aApps[22] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - TERRELL.au3"'
$aApps[23] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - WYLIE.au3"'
$aApps[24] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"'
$aApps[25] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"'
$aApps[26] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"'
$aApps[27] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"'
$aApps[28] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"'
$aApps[29] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"'
$aApps[30] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[31] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'
$aApps[32] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[33] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'

_ArrayDisplay($aApps)

I get this.

Capture.PNG

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

  • Developers
14 minutes ago, Earthshine said:

exactly. those loops are ??? you have one array. use this code to SEE what you have to work with before writing unnecessary loops

You make it sound we are in agreement but that is not the case. ;)
You need the 2 for/next loops to for the 3 column 8 rows in the current GUI. What I was eluding too is the fact that when you want to see more column or rows because you increase the table, you have to do exactly that. It really is quite simply when you think about it. :)

Let me play mister nice guy for a change and force feed the few simple changes that need to be made:

;~ #RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

; Declare arrays
Global $aRadio[34]
Global $aApps[34]

; List the path to your scripts
$aApps[0] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\J_Common - HP_Terrell.au3"'
$aApps[1] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Common - WYLIE.au3"'
$aApps[2] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\M_Common - Stonewall.au3"'
$aApps[3] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\Z_Common - CCMFS.au3"'
$aApps[4] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\K_Filer - Public.au3"'
$aApps[5] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_CCW Sales.au3"'
$aApps[6] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Credit.au3"'
$aApps[7] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Cust_Serv.au3"'
$aApps[8] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Design.au3"'
$aApps[9] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Engineering.au3"'
$aApps[10] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_FSR.au3"'
$aApps[11] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_HR.au3"'
$aApps[12] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_IT.au3"'
$aApps[13] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Marketing.au3"'
$aApps[14] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"'
$aApps[15] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"'
$aApps[16] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"'
$aApps[17] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"'
$aApps[18] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"'
$aApps[19] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"'
$aApps[20] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[21] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'
$aApps[22] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - TERRELL.au3"'
$aApps[23] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - WYLIE.au3"'
$aApps[24] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Sales.au3"'
$aApps[25] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Shipping.au3"'
$aApps[26] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Strategic.au3"'
$aApps[27] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Versicar.au3"'
$aApps[28] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - PA_Warranty.au3"'
$aApps[29] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 4.au3"'
$aApps[30] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[31] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'
$aApps[32] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\P_Priv - Plant 6.au3"'
$aApps[33] = '"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "\\wylie1\vincepr0\neverdeleteme\mapdrives\1\x.au3"'

$hGUI = GUICreate("Vince's Network Drive Script :D", 510, 340, 200, 200)
GUICtrlCreateLabel("Add which drives?", 10, 10, 126, 17)

GUICtrlCreateGroup("", 20, 20, 470, 270)

For $i = 0 To 2
    For $j = 0 To 11
        if UBound($aApps) > ($i * 12) + $j Then
            ; Extract the name of the app from the path
            $sName = StringRegExpReplace($aApps[($i * 12) + $j], "^.*\\|\..*$", "")
            ; Fill the array with the ControlIDs of the checkboxes
            $aRadio[($i * 12) + $j] = GUICtrlCreateCheckbox($sName, 30 + ($i * 150), 30 + ($j * 20), 135, 17)
        EndIf
    Next
Next

$hButton1 = GUICtrlCreateButton("Start", 30, 300, 129, 25, 0)
$hButton2 = GUICtrlCreateButton("Select All", 180, 300, 129, 25, 0)
$hButton3 = GUICtrlCreateButton("UnSelect All", 330, 300, 129, 25, 0)

GUISetState() ; You only need this once

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hButton1
            ; ownage has arrived
            For $i = 0 To 33
                If BitAND(GUICtrlRead($aRadio[$i]), $GUI_CHECKED) = $GUI_CHECKED Then
                    RunWait($aApps[$i])
                    ConsoleWrite("Running: " & $aApps[$i] & @CRLF) ; testing
                EndIf
            Next
            Exit
        Case $hButton2
            For $i = 0 To 33
                GUICtrlSetState($aRadio[$i], $GUI_CHECKED)
            Next
        Case $hButton3
            For $i = 0 To 33
                GUICtrlSetState($aRadio[$i], $GUI_UNCHECKED)
            Next
    EndSwitch
WEnd

 

Jos 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers
2 minutes ago, Earthshine said:

maybe that second loop should be 0 to 16.

Lets think about this one for a moment: there are 34 entries in the table and we have 3 columns, so my wild guess would be 12 rows to make that 36.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

the unregexer strikes again :zorro:

For $i = 0 To 2
    For $j = 0 To 11

  If UBound($aApps) > ($i * 12) + $j Then $aRadio[($i * 12) + $j] = GUICtrlCreateCheckbox(StringTrimRight(StringMid($aApps[($i * 12) + $j], stringinstr($aApps[($i * 12) + $j] , "\" , 0 , -1) + 1) , 5) , 30 + ($i * 150), 30 + ($j * 20), 135, 17)

    Next
Next

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

If the list of scripts is to keep expanding maybe use a listview with checkboxes. The script paths could be read to an array from a file,  C:\Program Files (x86)\AutoIt3\AutoIt3.exe could be replaced with  @AutoItExe and  placed in the RunWait command.

This should improve maintenance and save having to edit the script each time a new script needs to be added

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