FUNCTION and LFUNCTION
9.0C
The FUNCTION instruction defines a subroutine with parameters that has a defined scope that ends with a FUNCTIONEND instruction. It is the target of a parameterized CALL instruction. The instruction uses the following format:
|
|
|
|
|
|
|
|
Where:
label
Required. A Program Execution Label.
Flags Affected: NONE
Note the following:
The FUNCTION must be terminated with FUNCTIONEND instruction or a compilation error occurs.
The FUNCTION implementation supports both input parameter variables and local variables. The ENTRY instruction is required to differentiate the parameter variables from the local variables. The variable and code label references declared in the scope of a FUNCTION will not conflict with any other label references in a program. Therefore, FUNCTION labels are limited to n-3 characters (where 'n' is your selected label size).
All input parameter variables for the FUNCTION or LFUNCTION must be declared before the ENTRY instruction. The input parameter processing for the FUNCTION is the same as a ROUTINE.
All local variables for the FUNCTION or LFUNCTION must be declared immediately after the ENTRY instruction.
The defined label of a FUNCTION may be called by other compiled subroutines (i.e., publicly accessible). LFUNCTIONs may only be called within the program in which they are defined (no public access).
See Also: Example Code, FUNCTIONEND, ENTRY, CALL, FUNCTIONs, Program Control Instructions
![]() |