Jump to content
Sign in to follow this  
sandman

I'm not sure how to explain this..

Recommended Posts

sandman

Okay... I'll try to explain this the best I can.

Here is part of my script:

For $j = 1 To 31 Step 1
                If GUICtrlGetState($$i) = $GUI_CHECKED Then
                    FileWriteLine("temp.txt", $loc[$i])
                EndIf
            Next

So in my script I have checkboxes from $1 to $31, and I would not like to spend that much time writing script for each individual one.. I believe in PHP, GUICtrlGetState($$i) would work, but not in AutoIt. It says "badly formatted variable."

What I want this to do is that each time it repeats the loop, it will get the state of $1, then $2, and so on... How do I do this in AutoIt?


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites
james3mg

If you change your code to create the checkboxes using Assign() like (I think...untested):

For $i=1 To 31
  Assign($i,GUICtrlCreateCheckbox("Checkbox "&$i,5,($i*20)+5)
NextoÝ÷ Ù8^*.².ÖÞi¹^¶®¶­sdf÷"b33c¶ÓFò3´b33¶Ò77VÖær÷RFFâb33·BÖVâFòWBb33c¶¢W&Râ÷W"6öFP¢buT7G&ÄvWE7FFRWfÂb33c¶Òb33c´uTô4T4´TBFVà¢fÆUw&FTÆæRgV÷C·FV×çGBgV÷C²Âb33c¶Æö5²b33c¶Ò¢VæD`¤æW@

Again, I just slammed this out, I haven't tested these, but they should work :rolleyes: . But look into Assign() and Eval()...it should get you what you want.

Edit: btw, when I want to do something like this, I usually would create a 1-dimensional array with 30 elements (say $checkboxArray), so I could loop through the values using $checkboxArray[$i]

Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

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  

×