#

# LogiView

## How to Define the Validity Period of a System Variable

| ### What to do:
| As a prerequisite for this example you need to create the system variables as described in Assigning System Variables.
| Once a procedure/decision table is processed, the values of all system variables are cleared (baring in mind that all logic model variables have already been deleted). This procedure ensures identical variable states for repeated processing runs. The period of validity of a system variable therefore equals the time required to process a procedure/decision table, i.e. one processing cycle. If LogiView is to trigger a mask or field it may become necessary to retain the value of a variable over a period of several processing cycles, e.g. in order to define variable values of the "Pre-Field" trigger that need to be evaluated in a "Post Field" trigger event.
| To open the System Variables mask, select Manager > Macro > LogiView > System Variables.
| A list of all system variables and constants is opened.
| Select a menu option from the mask menu. (The Initialize Variables option sets the validity period to indefinite; Release Variable clears the value of a variable and restricts the validity period of the variable to one processing cycle.)
| Note that validity periods can only be modified collectively for all system variables.
| The Initialize and Release functions for variables cannot be executed in interactive mode. Execution of these functions is restricted to the following userexits:
| lgv_sys_ini() initialize system variable: Extends the validity period. Previously defined values are erased. The function returns the value "1" in case of an error, otherwise the return value is "0".
| lgv_sys_clr() release system variable: Resets the validity period to one processing cycle. The values of all variables are cleared. The function returns the value "1" in case of an error, otherwise the return value is "0".
| lgv_sys_get_ini() Verifies if the corresponding system variable has been initialized. If this is case, the function returns the value "1", otherwise the return value is "0".