Jump to content
Sign in to follow this  
serialzs

FOR LOOP with GUI

Recommended Posts

serialzs

@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

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
seandisanti

@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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.