Manjish Posted July 30, 2009 Posted July 30, 2009 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
Ascend4nt Posted July 30, 2009 Posted July 30, 2009 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) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
James Posted July 30, 2009 Posted July 30, 2009 Or you could just use an array. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Manjish Posted July 30, 2009 Author Posted July 30, 2009 thanks.. Assign() works [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Xand3r Posted July 30, 2009 Posted July 30, 2009 (edited) For $i=1 to 10 Execute("$checkbox"&$i&" = GUICtrlCreateCheckbox('',32, (72+(($i-1)*40)), 553, 25)") Next Edited July 30, 2009 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now