Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 83
Using the SIO Procedures: An Example
!------------------------------------------------------------
! Main procedure prompts the user to enter a function to read
! or write to the disk file or exit the program.
!------------------------------------------------------------
PROC LOG^PROG MAIN;
BEGIN
STRING CMD;
! Initialize the SIO files:
CALL INITIALIZE^FILES;
! Loop until user requests to exit:
WHILE 1 = 1 DO
BEGIN
PRINT^BLANK;
CMD := GET^COMMAND;
! Call procedure depending on function selected:
CASE CMD OF
BEGIN
"r" -> CALL READ^RECORDS;
"a" -> CALL WRITE^RECORDS;
"x" -> CALL EXIT^PROGRAM;
OTHERWISE -> CALL INVALID^SELECTION;
END;
END;
END;