Difference between revisions of "Variable Reference"

No change in size ,  20:13, 14 February 2012
m
→‎Defining Variables: Changed to American English for consistency
imported>Cipscis
(→‎Defining Variables: Added link to expression reference)
imported>Cipscis
m (→‎Defining Variables: Changed to American English for consistency)
Line 11: Line 11:
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, [[Expression_Reference|expressions]] can be used in variable initialisations.
If a variable is declared outside of a function or event, it can only be initialized as a [[Literals_Reference|literal]]. Inside a function or event, [[Expression_Reference|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