Sign in to follow this  
Followers 0
Manjish

problem with "Eval"

5 posts in this topic

Hi I wanted to create a GUI with variable number of checkboxes. I am using this:

For $i=1 to 10
Eval("checkbox"&$i) = GUICtrlCreateCheckbox("",32, (72+(($i-1)*40)), 553, 25)
Next

I want to assign each checkbox a diffn variable .. like $checkbox1, $checkbox2, $checkbox3 etc. So I am using Eval. But the above syntax yeilds an error: "Illegal text at the end of statement (one statement per line).:".

Please help.


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites



I think what you want is Assign()

Eval is used for variables that were either defined ('Local $myVar') or 'Assigned' using Assign().

Basically, it's used to report what the value is. For example, the below prints out 12 to the console:

Local $myVar=12
ConsoleWrite("$myVar="&Eval("myVar")&@LF)

Share this post


Link to post
Share on other sites

thanks.. Assign() works


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

For $i=1 to 10
Execute("$checkbox"&$i&" = GUICtrlCreateCheckbox('',32, (72+(($i-1)*40)), 553, 25)")
Next

Edited by Xand3r

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

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