Guardian Programmer's Guide

Table Of Contents
Communicating With Disk Files
Guardian Programmer’s Guide 421922-014
5 - 96
Using Alternate Keys With a Relative File
! Print the record on the terminal:
PRINT^STR("Date: " & RECORD.DATE FOR DATESIZE);
PRINT^STR("Comments: " & RECORD.DATA FOR
RECORD.DATA^LEN);
PRINT^BLANK;
! Prompt the user to read the next record. The user
! must respond "y" to accept, otherwise the procedure
! returns to select the next function:
SBUFFER ':=' ["Do you want to read another ",
"record (y/n)? "]
-> @S^PTR;
CALL WRITEREADX(TERMNUM,SBUFFER,@S^PTR '-' @SBUFFER,
BUFSIZE,COUNT^READ);
IF <> THEN CALL FILE^ERRORS(TERMNUM);
SBUFFER[COUNT^READ] := 0;
END
UNTIL NOT (SBUFFER[0] = "y" OR SBUFFER[0] = "Y");
END;