Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 98
Accessing an Unlabeled Tape File: An Example
!------------------------------------------------------------
! Procedure to rewind the tape to BOT, checking that the
! tape is loaded. If not, then the rewind operation
! results in error 100. The user is prompted to load the
! tape before continuing.
!------------------------------------------------------------
PROC LOAD^TAPE;
BEGIN
INT ERROR;
INT COUNT^READ;
CHECK^AGAIN:
CALL CONTROL(TAPENUM,6);
IF <> THEN
BEGIN
CALL FILE_GETINFO_(TAPENUM,ERROR);
IF ERROR = 100 THEN
BEGIN
SBUFFER ':=' ["Tape Not Ready. Press RETURN ",
"When Ready to Continue: "] -> @S^PTR;
CALL WRITEREADX(TERMNUM,SBUFFER,@S^PTR '-' @SBUFFER,
BUFSIZE,COUNT^READ);
GOTO CHECK^AGAIN;
END
ELSE CALL FILE^ERRORS(TERMNUM);
END;
END;