Difference between revisions of "Declaring variables"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>JOG
imported>JOG
m
Line 12: Line 12:
</pre>
</pre>
   
   
A local variable can be placed anywhere within the script code, it only needs to be declared before the first command that uses it. Usually you declare all variables on top of the script, though, to improve the script's readability.





Revision as of 10:03, 24 March 2006

short      -32,768 to 32,767 
long      -2,147,483,648 to 2,147,483,647 
float      1.18E-38 to 3.40E38 (precision = 7 digits) 

You can declare three types of variables through scripts and as global variables. Variable names are not case sensitive. Declare with type and name:

short myShortVariable 
long  myLongVariable   
float myFloatVariable 

A local variable can be placed anywhere within the script code, it only needs to be declared before the first command that uses it. Usually you declare all variables on top of the script, though, to improve the script's readability.


Scripts can also declare and use reference variables:

ref      myRefVariable