Variable – a named memory location used to refer data at that location. In other words, variable - the name, which may be due to a certain value.
Variables can have different types. The type of a variable defines the set of values that can be stored in the variable and the set of operations that can be performed on that variable. Variables in the Postprocessors generator can be one of the following types:
Variables can be local scope or global. Local scope variables are accessible only in the current program or subprogram. Global variables can be accessed in any program or sub of the postprocessor. To define a global variable define it in the special <COMMON> program. All variables defined in the <COMMON> program are global.
The Postprocessor generator language allows definition of variables anywhere in the code of a program or a subprogram, but it is a good practice to define the variables used in the program at the program head. Use the following syntax to define a variable:
<Variable name>: <Type of the variable>
The following is an example of variable definition and usage.
nn: Integer ! Integer type variable definition
xx: Real ! Real type variable definition
yy: Real ! Real type variable definition
rr: Real ! Real type variable definition
ss: String ! String type variable definition
nn = 2 ! Variable value assignment
xx = 7.43 ! Variable value assignment
yy = 12.6 ! Variable value assignment
rr = nn * sqr(xx^2 + yy^2) ! variables in expression
ss = "Result = " ! Variable assignment
print ss, rr ! debug output value of the variable