Jump to content

FOR LOOP with GUI


serialzs
 Share

Recommended Posts

@all

i have a autoit program problem. i cant get how to work it right :P

Please help me here's my prob..

GUICtrlCreateIcon (@ScriptDir & $icon1,-1, 10, $1st)

$1 = GuiCtrlCreateCheckbox($progname1, 55, $1a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon2,0, 10, $2nd)

$2 = GuiCtrlCreateCheckbox($progname2, 55, $2a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon3,-1, 10, $3rd)

$3 = GuiCtrlCreateCheckbox($progname3, 55, $3a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon5,-1, 10, $4th)

$5 = GuiCtrlCreateCheckbox($progname5, 55, $4a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon4,-1, 10, $5th)

$4 = GuiCtrlCreateCheckbox($progname4, 55, $5a, -1, -1)

For $i = 5 to 1 Step -1

If GUICtrlRead("$" $i) = 1 then

RunWait(@ScriptDir & $icon1)

EndIf

Next

i use FOR command instead of IF command because it's a Long Script if i use it.:lmao:

My problem is GUICtrlRead("$" $i) doesnt work..

anyone know a solution?

thanks in advance... :(

-=[serialzs]=-

Edited by serialzs
Link to comment
Share on other sites

  • Developers

try something like:

Dim $h_i[6]
GUICtrlCreateIcon (@ScriptDir & $icon1,-1, 10, $1st)
$h_i[1] = GuiCtrlCreateCheckbox($progname1, 55, $1a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon2,0, 10, $2nd)
$h_i[2] = GuiCtrlCreateCheckbox($progname2, 55, $2a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon3,-1, 10, $3rd)
$h_i[3] = GuiCtrlCreateCheckbox($progname3, 55, $3a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon5,-1, 10, $4th)
$h_i[5] = GuiCtrlCreateCheckbox($progname5, 55, $4a, -1, -1)

GUICtrlCreateIcon (@ScriptDir & $icon4,-1, 10, $5th)
$h_i[4] = GuiCtrlCreateCheckbox($progname4, 55, $5a, -1, -1)

For $i = 5 to 1 Step -1
    If GUICtrlRead($h_i[$i]) = 1 then 
        RunWait(@ScriptDir & $icon1)
    EndIf
Next
Edited by JdeB

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

@all

i have a autoit program problem. i cant get how to work it right :P

Please help me here's my prob..

i use FOR command instead of IF command because it's a Long Script if i use it.:lmao:

My problem is GUICtrlRead("$" $i) doesnt work..

anyone know a solution?

thanks in advance... :(

-=[serialzs]=-

GUICtrlRead("$" $i)

that isn't a valid concatenation... toss in a "&" between the literal string and variable name

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