Stevenn Posted July 6, 2012 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
Castillo Posted July 6, 2012 Posted July 6, 2012 I actually don't understand why do you need this. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Stevenn Posted July 6, 2012 Author Posted July 6, 2012 because i have a gui window and i need to use it more than once without recreating it
Castillo Posted July 6, 2012 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Anderl Posted July 6, 2012 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 "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Castillo Posted July 6, 2012 Posted July 6, 2012 Oh, was lower case "button", my bad. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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