Loading...
 

Variable

Variable

Variables in InstantView® have the following properties:

untyped
Variables have no type. Variables are - just like stack elements - containers and can hold all values possible in InstantView®.

Initial value
Before the first value assignment, all variables hold the value INVALID

Hierarchical Scopes
Variables have a scope:

Scope Definition with Note
global scope the variable is known in the whole application GlobalVar
Scope module the variable is known in the module where it was defined and in all modules derived from this module (inheritance) Var Value at the beginning of the scope always INVALID
StaticVar
only from DLL version 4.6.0.000000
holds the last assigned value
local scopes the variable exists only within a macro or { } - block
Local scopes can form a hierarchy among themselves (nested { } - blocks)
LocalVar
only from DLL version 4.6.0.170276
inherited variables are independent in different modules = hold different values
StaticVar
only from DLL version 4.6.0.000000
inherited variables are identical in different modules = hold the same value

Variables with the same name in different scopes hide the variable in the parent scopes.

Static or non-static
In the module scope, static and non-static variables differ if at least two modules are derived from a basic module.
With a static variable, all derivatives always refer to the same value. For non-static variables, each module has its own instance independent of the "sibling modules".
Local variables have the value INVALID when entering their scope. Values assigned within the scope are "forgotten" when leaving the scope.
Local static variables hold the last assigned value even after leaving the scope.

Transaction-oriented
Global and Module Scope variables are reset to the last value assigned before the beginning of a transaction when a transaction is aborted.
Local variables are not transaction-oriented (not useful because of their short life span!).

Declaration of a variable

Call

Value assignment

Increment / Decrement

Comparison with variables in C++