Jump to content

problem with "Eval"


Recommended Posts

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
Link to comment
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)
Link to comment
Share on other sites

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

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