CALL Examples
Example 1:
|
|
|
|
Initiates the subroutine designated by the Program Execution Label JULNDATE. If the subroutine ends with a RETURN, execution resumes with the instruction immediately following the CALL.
Example 2:
|
|
|
|
Initiates the subroutine designated by the Program Execution Label GREGDATE only if ANS is equal to a "Y". The preceding RETURN example still applies.
Example 3:
|
|
|
|
Transfers control to the subroutine EVENTCHK if any of the various graphical objects have been activated by the mouse. This function code is only available with PLBCMP in a GUI environment.
Example 4:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This CALL initiates the LROUTINE JULNDATE using four parameters. DATE is a DIM field and YY, MM and DD are all FORM fields. The corresponding LROUTINE instruction specifies four parameters also and they must match the type of the parameters of the CALL instruction. During the execution of the subroutine, reference to any of the variables on the LROUTINE list actually refer to the corresponding variables on the CALL list. This example also shows the usage of local labels that start with a '#' character.
Example 5:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This CALLS the JULNDATE subroutine located in the DATES.PLC module. DATES.PLC is loaded automatically if not already loaded.
Example 6:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This CALLS the JULNDATE subroutine located in the DATES.PLC module and shows the implementation of the GIVING keyword to retrieve the converted DATE. DATES.PLC is loaded automatically if not already loaded.
Example 7:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These CALLS instructions each create a unique instance of the DATES LOADMOD with their own copies of the variables defined in the LOADMOD (#JULIAN, #YEAR, #MONTH, and #DAY).
![]() |