pTAL Reference Manual (H06.03+)

Compiler Directives
HP pTAL Reference Manual523746-005
17-62
Examples
Examples
The SOURCE directive in Example 17-33 on page 17-62 instructs the compiler to
process the file until an end of file occurs. (Any SECTION directives in the file
ROUTINES are treated as comments.)
This SOURCE directive in Example 17-34 on page 17-62 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 17-35 on page 17-62 shows how you can specify the order in which the
compiler is to read the sections, regardless of their order in the source file.
Example 17-32. 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
Example 17-33. SOURCE Directive
?SOURCE $src.current.routines
Example 17-34. SOURCE Directive
?SOURCE $src.current.routines (sec1, sec2, sec3)
Example 17-35. SOURCE Directive
?SOURCE $src.current.routines (sec1)
?SOURCE $src.current.routines (sec2)
?SOURCE $src.current.routines (sec3)