The table below describes the lifetime of a variable and when a variable's initial value is set.
The lifetime of a variable refers to the period of time a variable exists. It depends on the module or submodule in which it is declared.
The initiation of a variable refers to when ATEasy sets a variable's initial value. The initial value can be set in the Value page of the variable's Properties window.
|
Module/Submodule |
Lifetime of a Variable |
Initiation of a Variable |
|
Program |
As long as the program is active. When multiple programs exist within a project, only one program can be active (running) at a time. Only variables from the active program are accessible. When a second program becomes active, variables from the first become inaccessible. |
The initial value of the variable is set when the program runs. |
|
System |
As long as the application is running. |
The initial value of the variable is set when the entire application is started. |
|
Driver |
As long as the application is running. |
The initial value of the variable is set when the entire application is started. |
|
Procedure |
As long as the procedure is running (called). Procedure variables cannot be public. |
The initial value of the variable is set when the procedure is called. |
|
Form |
As long as the form is loaded. |
The initial value of the variable is set when the form is loaded. |