Rail3D*


 

Variables



Names

Names are case-sensitive, and must start with a letter.

Declaration

Variables must be declared the first time they are used, e.g.

 int i;
 float theta=0.5;
 signal sig2=sig1.NextSignal();

Scope

If a variable is declared in the Init() procedure it has global scope, otherwise its scope is restricted to the procedure in which it is declared.

Persistence

If a variable is declared as persistent, its current value is saved with the layout and restored when the layout is loaded; otherwise, it will be initialised each time the layout is loaded. Persistent variables are often needed for things like signal scripts, or for document scripts dealing with timetabling, e.g.

 persistent int counter;


import