EXTERNAL Examples
Example 1:
|
|
|
This instruction defines JUNLDATE as the name of a separately compiled module and the ROUTINE name used when it is called.
Example 2:
|
|
|
|
This instruction defines JULNDATEas the name of a separately compiled module that is referenced in the program as JDATE. The actual ROUTINE name in the separately compiled module is JULNDATE.
Example 3:
|
|
|
|
This instruction defines DATES as the name of a separately compiled module with a ROUTINE named JULNDATE that is referenced in the program as JDATE. The actual ROUTINE name in the separately compiled program is JULNDATE.
Example 4:
|
|
|
|
This instruction defines DATE1 as an alias for DATES that is the name of a separately compiled module with a ROUTINE named JULNDATE that is referenced in the program as JDATE1. The actual ROUTINE name in the separately compiled program is JULNDATE. If both JDATE1 in this example and JDATE in the previous example were both called from the same program, the external module DATES would be loaded twice thus enabling multiple instances of the same routine.
Example 5:
|
|
|
|
|
| ||
|
|
|
|
|
| ||
|
| ||
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These two programs show the relationship between the main program EXTTEST) and the external module (DATES). Both modules may be compiled separately. The EXTERN statement in EXTTEST provides the correct linkage to the JULNDATE routine. It also defines the local label (JDATE1) used in the calling program. Execution of EXTTEST will result in a CALL to the JULNDATE routine in DATES.
![]() |