Language Reference Guide : Language Elements : Variables : How You Can Initialize Variables
 
Share this page          
How You Can Initialize Variables
When OpenROAD starts an application, any global variables associated with the application are initialized. Similarly, when you call a frame or procedure, OpenROAD initializes the variables associated with the frame or procedure.
OpenROAD uses the default value of the variable as the initial setting. For field and menu items or global variables, you can define this value in the OpenROAD Workbench. If you do not, OpenROAD uses the system defaults. OpenROAD also uses the system default for variables declared in the initialize statement of a frame script.
For simple variables, the system defaults are zero for numeric data types, or the empty string ('') for non-nullable character data types. However, you can overwrite these defaults using the default clause, for example:
i = integer not null default 3;
For reference variables, OpenROAD creates an object of the declared class and sets the reference variable to reference that object. The attributes of this object are initialized to their default values (which are specified in the class definition). For attributes that are reference variables, you can set the initial value of the variable to null. In this case, no object is created for the reference variable.