Jump to content

rename a variable?


Stevenn

Recommended Posts

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 :D

Link to comment

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...