pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

?source FILEn
int i1
struct s(*);
begin
...
end;
! All other common declarations and directives in the
! compilation ...
! End of global declarations
?BEGINCOMPILATION
! All nonglobal declarations,
! including procedure declarations
! End of COMP1
2. Extract all directives and declarations from the beginning of COMP1 to (but not including)
BEGINCOMPILATION. Put them in a new source file called GLOBALS (see Example 339
(page 376)).
Example 339 New GLOBALS Source File
! GLOBALS
?FIELDALIGN (SHARED2)
name x;
?source FILE1
?source FILE2
...
?source FILEn
int i1
struct s(*);
begin
...
end;
! All other common declarations and directives in the
! compilation
! End of GLOBALS
3. Use a SOURCE directive to include GLOBALS in COMP1 (as in Example 340 (page 376)).
Example 340 Corrected SAVEGLOBALS Compilation Source File
! COMP1
?source GLOBALS
! End of global declarations
?BEGINCOMPILATION
! All other non-global declarations,
! including procedure declarations ...
! End of COMP1
4. In each file that depended on the global data declarations file that the original COMP1
produced:
Use a SOURCE directive to include GLOBALS.
The SOURCE directive must appear before any other declarations and must be immediately
followed by the BEGINCOMPILATION directive.
After the BEGINCOMPILATION directive, specify any additional directives that were
originally specified in the compilation command.
376 Compiler Directives