Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 62
Writing the Program
IF <> THEN CALL FILE^ERRORS(TERMNUM);
! Display comments:
CALL WRITEX(TERMNUM,LOG^RECORD.COMMENTS,504);
IF <> THEN CALL FILE^ERRORS(TERMNUM);
! Increment record counter:
INDEX := INDEX + 1;
! Prompt the user to read the next record:
PRINT^BLANK;
SBUFFER ':='
"Do You Want To Read the Next Record (y/n) "
-> @S^PTR;
CALL WRITEREADX(TERMNUM,SBUFFER,
@S^PTR '-' @SBUFFER,
BUFSIZE,COUNT^READ);
IF <> THEN CALL FILE^ERRORS(ERROR);
END;
END
UNTIL (NOT (SBUFFER[0] = "y" OR SBUFFER[0] = "Y"))
OR INDEX = 4;
! No more records in this record block. Reset record
! count to 0 and read next record, if requested:
INDEX := 0;
END
UNTIL NOT (SBUFFER[0] = "y" OR SBUFFER[0] = "Y");
! Close the tape file:
CALL FILE_CLOSE_(TAPENUM);
END;