Kiti Posted July 19, 2008 Share Posted July 19, 2008 (edited) Why I don't get a GUI with the word "something" written 5 times? Edit: And, of course, what can I do to get what I want? $Form1 = GUICreate("Form1", 224, 142, 338, 269) $Label1 = GUICtrlCreateLabel("Label1", 44, 16, 36, 17) $Label2 = GUICtrlCreateLabel("Label2", 44, 36, 36, 17) $Label3 = GUICtrlCreateLabel("Label3", 44, 56, 36, 17) $Label4 = GUICtrlCreateLabel("Label4", 44, 76, 36, 17) $Label5 = GUICtrlCreateLabel("Label5", 44, 96, 36, 17) For $i = 1 to 5 $string = "$Label" & $i Guictrlsetdata($string, "Something") Next GUISetState(@SW_SHOW) While 1 sleep(100) WEnd Thank you! muttley Edited July 19, 2008 by Kiti Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
cppman Posted July 19, 2008 Share Posted July 19, 2008 (edited) I would recommend, however, that you put the labels in an array so you wouldn't need to call "Eval". $Form1 = GUICreate("Form1", 224, 142, 338, 269) $Label1 = GUICtrlCreateLabel("Label1", 44, 16, 36, 17) $Label2 = GUICtrlCreateLabel("Label2", 44, 36, 36, 17) $Label3 = GUICtrlCreateLabel("Label3", 44, 56, 36, 17) $Label4 = GUICtrlCreateLabel("Label4", 44, 76, 36, 17) $Label5 = GUICtrlCreateLabel("Label5", 44, 96, 36, 17) For $i = 1 to 5 $string = "Label" & $i Guictrlsetdata(Eval($string), "something") Next GUISetState(@SW_SHOW) While 1 sleep(100) WEnd Edited July 19, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
Kiti Posted July 19, 2008 Author Share Posted July 19, 2008 I would recommend, however, that you put the labels in an array so you wouldn't need to call "Eval". $Form1 = GUICreate("Form1", 224, 142, 338, 269) $Label1 = GUICtrlCreateLabel("Label1", 44, 16, 36, 17) $Label2 = GUICtrlCreateLabel("Label2", 44, 36, 36, 17) $Label3 = GUICtrlCreateLabel("Label3", 44, 56, 36, 17) $Label4 = GUICtrlCreateLabel("Label4", 44, 76, 36, 17) $Label5 = GUICtrlCreateLabel("Label5", 44, 96, 36, 17) For $i = 1 to 5 $string = "Label" & $i Guictrlsetdata(Eval($string), "something") Next GUISetState(@SW_SHOW) While 1 sleep(100) WEnd That works perfect! Thank you so much! Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
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