Guardian Programmer's Guide

Table Of Contents
Communicating With Disk Files
Guardian Programmer’s Guide 421922-014
5 - 93
Using Alternate Keys With a Relative File
!------------------------------------------------------------
! Procedure to ask the user for the next function to do:
!
! "r" to read records
! "u" to update a record
! "i" to insert a record
! "x" to exit the program
!
! The selection made is returned as the result of the call.
!------------------------------------------------------------
INT PROC GET^COMMAND;
BEGIN
INT COUNT^READ;
! Prompt the user for the function to be performed:
PRINT^BLANK;
PRINT^STR("Type 'r' for Read Log, ");
PRINT^STR(" 'u' for Update Log, ");
PRINT^STR(" 'i' for Insert a comment, ");
PRINT^STR(" 'x' for Exit. ");
PRINT^BLANK;
SBUFFER ':=' "Choice: " -> @S^PTR;
CALL WRITEREADX(TERMNUM,SBUFFER,@S^PTR '-' @SBUFFER,
BUFSIZE,COUNT^READ);
IF <> THEN CALL FILE^ERRORS(TERMNUM);
SBUFFER[COUNT^READ] := 0;
RETURN SBUFFER[0];
END;