pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
USEGLOBALS and BEGINCOMPILATION (pTAL Compiler Only)
If USEGLOBALS is active, the compiler ignores all SOURCE directives until it encounters
BEGINCOMPILATION. For more information about how these directives interact, see Saving and
Using Global Data Declarations (page 372).
Including System Procedure Declarations
You can use SOURCE directives to read in external declarations of system procedures from the
EXTDECS files. In these files, the procedure name and the corresponding section name are the
same. EXTDECS0 contains the current RVU of system procedures.
In Example 356 (page 419), a SOURCE directive specifies the current version of system procedures.
A NOLIST directive suppresses the listings for the system procedures. Place NOLIST and SOURCE
on the same line, because the line containing the NOLIST directive is not suppressed.
Example 356 SOURCE Directive Specifying System Procedure Declarations
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS0 (
? PROCESS_DEBUG_, PROCESS_STOP_)
! Suppress listings
! Read external declarations of current system procedures
?POPLIST
A procedure in the same source file can then call the procedures listed in the preceding SOURCE
directive, as in Example 357 (page 419).
Example 357 Procedure That Calls Procedures Specified by SOURCE Directive
PROC a MAIN;
BEGIN
INT x, y, z, error;
! Code for manipulating x, y, and z
IF x = 5 THEN CALL PROCESS_STOP_;
CALL PROCESS_DEBUG_; ! Call procedures listed
END; ! in SOURCE directive
Examples
The SOURCE directive in Example 358 (page 419) instructs the compiler to process the file until an
end of file occurs. (Any SECTION directives in the file ROUTINES are treated as comments.)
Example 358 SOURCE Directive
?SOURCE $src.current.routines
This SOURCE directive in Example 359 (page 419) reads three sections from the source file. It reads
the files in the order in which they appear in the source file, not in the order specified in the
SOURCE directive. (The specified files appear in the source file in the order sec3, sec2, and
sec1, so they are read in that order.)
Example 359 SOURCE Directive
?SOURCE $src.current.routines (sec1, sec2, sec3)
Example 360 (page 420) shows how you can specify the order in which the compiler is to read the
sections, regardless of their order in the source file.
SOURCE 419