2. Language Elements : Variables : Simple Variables : How You Can Declare Simple Variables
 
Share this page                  
How You Can Declare Simple Variables
The syntax for declaring a simple variable is:
name = datatype [with null|not null] [not default|with default|[with] default defaultvalue]
The following example shows a local variable declaration for an integer variable:
i = integer;
By default, all simple variables are nullable. If you do not want the variable to be nullable, you must include the not null clause in the declaration, for example:
i = integer not null;
By default, all numeric simple variables are assigned a default value of zero, and all character simple variables are assigned a default value of the empty string (''). If you want to specify a different default value, you must include the default clause. The default value must be null, a literal, or one of the system constants defined in the Language Reference Guide online help, for example:
i = integer not null default false;
The with null, not default, and with default (without a value) clauses are provided for syntactic compatibility with SQL, but they have no effect in OpenROAD.