TAL Programmer's Guide
String-Display Programs
Sample Programs
A–2 096254 Tandem Computers Incorporated
Example A-2 shows a C-series version of the previous string-display program.
Example A-2. C-Series String-Display Program)
?NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (CLOSE, INITIALIZER,
? MYTERM, OPEN, WRITE) !Include system procedures,
! but suppress their listings
?LIST !Resume listing
PROC myproc MAIN; !Declare MYPROC procedure
BEGIN
!Data declarations
INT termname[0:11]; !Terminal name
INT filename; !File number for terminal
STRING buffer[0:79]; !Array for output message
INT length; !Variable for message length
CALL INITIALIZER; !Process startup
! initialization
CALL MYTERM (termname); !Get terminal name
CALL OPEN (termname, filenum); !Open terminal; get number
buffer ':=' "Hello, World"; !Move statement
length := 12; !Assignment statement
CALL WRITE (filenum, buffer, length);
!Write message to terminal)
CALL CLOSE (filenum); !Close terminal
END; !End MYPROC