Difference between revisions of "Variable Reference"

Jump to navigation Jump to search
204 bytes added ,  20:07, 14 February 2012
→‎Defining Variables: Initialisation outside of functions and events can only be to literals - no expressions
imported>Jlundin
 
imported>Cipscis
(→‎Defining Variables: Initialisation outside of functions and events can only be to literals - no expressions)
Line 10: Line 10:


You may optionally follow the variable with an equals sign and an expression (in a function) or value (in a script) to initialize the variable with that value on the same line. If you do not give it an initial value, then it will start with a [[Default Value Reference|default value]].
You may optionally follow the variable with an equals sign and an expression (in a function) or value (in a script) to initialize the variable with that value on the same line. If you do not give it an initial value, then it will start with a [[Default Value Reference|default value]].
If a variable is declared outside of a function or event, it can only be initialised as a [[Literals_Reference|literal]]. Inside a function or event, expressions can be used in variable initialisations.


Variables in scripts do not have to be defined before use, but variables inside functions do. Variables defined in scripts may have [[Flag Reference|flags]].
Variables in scripts do not have to be defined before use, but variables inside functions do. Variables defined in scripts may have [[Flag Reference|flags]].
Anonymous user

Navigation menu