Difference between revisions of "Variables and Properties"
Jump to navigation
Jump to search
m
Typo: "it's" -> its"
imported>Henning m (→See Also) |
imported>Kivan m (Typo: "it's" -> its") |
||
Line 3: | Line 3: | ||
Variables and Properties are similar things, they both "hold" values and objects. A variable is "private" meaning that only that script is aware of them, can set their contents, and get their contents. A Property is essentially a variable that other scripts can access, their contents can be set and get by a other scripts. | Variables and Properties are similar things, they both "hold" values and objects. A variable is "private" meaning that only that script is aware of them, can set their contents, and get their contents. A Property is essentially a variable that other scripts can access, their contents can be set and get by a other scripts. | ||
If a variable or property holds a numeric value, like an integer, get/set returns | If a variable or property holds a numeric value, like an integer, get/set returns its value. If a variable or property holds an object, you can access that object's properties and functions. (This is analogous to a reference variable from the old scripting system.) | ||
=Declaring Variables= | =Declaring Variables= |