Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 73
Using the SIO Procedures: An Example
additional records. The procedure returns when either the user declines to read
any more or the program reaches the end of the disk file.
The WRITE^RECORDS procedure is similar to READ^RECORDS but appends
records to the data file instead of reading. This procedure is called by the main
program when the user selects appending from the main menu. First, it calls the
OPEN^OUTPUT procedure to open the disk file in write-only mode, which forces
writes to the end of the file. It goes on to prompt the user for the contents of the
record to be written, and then it writes the record to the disk file and prompts the
user to enter another record. The procedure returns when the user declines to
enter another record.
The EXIT^PROGRAM procedure is called by the main procedure when the user
chooses to stop the program. This procedure uses the CLOSE^FILE procedure to
flush the buffer and close the files before stopping the process.
The INVALID^SELECTION procedure is called by the main procedure when the
user makes an invalid selection from the menu. This procedure informs the user of
the invalid selection and then returns to the main procedure to display the menu
again.
The WRITE^LINE procedure is called by several procedures to write a line to the
IN file.