TAL Programmer's Guide
Compiling With Saved Global Data
Compiling Programs
14–24 096254 Tandem Computers Incorporated
Saved Global Data
Compilation Session
The following session shows how you can save and retrieve global data. It also shows
how you can check the syntax of global data declarations and how to save and retrieve
such declarations.
Creating the Source File
Using an editor, you can create a source file, such as MYPROG, that includes
BEGINCOMPILATION and USEGLOBALS.
!Source file MYPROG
!If USEGLOBALS is active, the compiler ignores text lines
! and SOURCE directives (but not other directives) until
! BEGINCOMPILATION appears.
?SOURCE globfile
?SOURCE glbfile1 (section1, section2)
?SOURCE moreglbs
INT ignore_me1;
INT ignore_me2;
?BEGINCOMPILATION !Compile code that follows
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS
?POPLIST
PROC my_first_proc;
BEGIN
!Lots of code
END;
PROC my_last_proc;
BEGIN
!Lots of code
END;
Saving the Global Data
The following compilation command compiles MYPROG and produces object file
MYOBJ. The SAVEGLOBALS directive saves global declarations in file TALSYM and
the global initializations in object file MYOBJ:
TAL /IN myprog/ myobj; SAVEGLOBALS talsym
Retrieving the Saved Global Data
The following compilation command recompiles MYPROG and produces object file
NEWOBJ. The USEGLOBALS directive retrieves the saved global declarations from
file TALSYM. The SEARCH directive retrieves the global initializations from MYOBJ:
TAL /IN myprog/ newobj; USEGLOBALS talsym, SEARCH myobj