TAL Programmer's Guide

Modular Programming Example
Sample Programs
A–14 096254 Tandem Computers Incorporated
Input File Module
Example A-6c shows the source code for the input file module, which contains all
procedures that manipulate the input file. If you make I/O changes, only this module
needs to be recompiled. The initialization module, for example, calls a procedure in
this module. This module declares a private global data block, which is accessible only
to the procedures in this module.
Example A-6c. D-Series Input File Module (Page 1 of 3)
!File name INS
NAME in_file_handler;
?PUSHLIST, NOLIST, SOURCE recdefs !BLOCK RECORD_DEFS
?POPLIST
?PUSHLIST, NOLIST, SOURCE inits (default) !BLOCK DEFAULT_VOL
?POPLIST
?PUSHLIST, NOLIST, SOURCE msgs (msglit) !BLOCK MSG_LITERALS
?POPLIST
BLOCK PRIVATE;
INT in_file; !Input file number
END BLOCK;
!Following are external procedure declarations:
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
? FILE_CLOSE_, FILE_GETINFO_)
?POPLIST
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
? FILE_OPEN_, FILENAME_RESOLVE_)
?POPLIST
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
? PROCESS_STOP_, READX)
?POPLIST
?PUSHLIST, NOLIST, SOURCE msgp ! MESSAGE_MODULE
?POPLIST
?PUSHLIST, NOLIST, SOURCE inp ! IN_FILE_HANDLER
?POPLIST ! (consistency checks)