Stevenn Posted July 6, 2012 Share Posted July 6, 2012 hey how can I rename a variable? like i have this: mywindow = guiCreateWindow( 100, 100, 100, 100, "lol", false) mylabel = guiCreateLabel(100, 100, 100, 100, "text", mywindow, false) mybutton = guiCreateButton(100, 100, 100, 100, "lol", mywindow, false) addEventHandler("onClientGUIClick", resoucreRoot, function() if source == mybutton then setVariable(mybutton, thenewVariable) end end) Do you know what I mean? :D Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 I actually don't understand why do you need this. Link to comment
Stevenn Posted July 6, 2012 Author Share Posted July 6, 2012 because i have a gui window and i need to use it more than once without recreating it Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 Set element data to the button then check it. You can't "rename" a variable, you can just create it again, like this: mybutton = guiCreateButton(100, 100, 100, 100, "lol", mywindow, false) newVariable = mybutton myButton = nil Link to comment
Anderl Posted July 6, 2012 Share Posted July 6, 2012 Set element data to the button then check it.You can't "rename" a variable, you can just create it again, like this: mybutton = guiCreateButton(100, 100, 100, 100, "lol", mywindow, false) newVariable = myButton myButton = nil mybutton = guiCreateButton(100, 100, 100, 100, "lol", mywindow, false) newVariable = mybutton mybutton = nil Link to comment
Castillo Posted July 6, 2012 Share Posted July 6, 2012 Oh, was lower case "button", my bad. Link to comment
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