Variable Naming and Parser Rules
Variable Naming Rules
When naming variable the following rules apply:
- LION keywords cannot not be used as variable names.
- LION System Item names cannot be used as variable names.
- Names of Globally defined variables cannot be reused locally or as routine variable/parameter.
- In functions (routines returning a result), the variable name 'RESULT' is reserved for the returned result value.
Short Naming
When local defined structure elements are name uniquely, LION allows a short form of referring to the element. Besides '<struct>.<element>' also the short form '<element>' is allowed. When the element name is not unique a parsing error will occur.
Note: The maximum structure depth for this short form naming is three!
Parsing Rules
When the parser is resolving variable names in the code the following rules and order of resolving apply:
- Variable name 'RESULT' within a routine
- Parameter names
- Routine local variable names
- Global class definition names
- Fully qualified local definition names
- Local print definition names, Local file id names, Screen definition names, Print definition names
- Local definition names including the short form element names
- Global definition names
- System definition names