Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 94
Accessing an Unlabeled Tape File: An Example
!------------------------------------------------------------
! Procedure for displaying file-system error numbers on the
! terminal. The parameter is the file number. The file
! name and the error number are determined from the file
! number and FILE^ERRORS^NAME is then called to do the
! display.
!
! FILE^ERRORS^NAME also stops the program after displaying
! the error message.
!------------------------------------------------------------
PROC FILE^ERRORS(FNUM);
INT FNUM;
BEGIN
INT ERROR;
STRING .FNAME[0:MAXFLEN - 1];
INT FLEN;
CALL FILE_GETINFO_(FNUM,ERROR,FNAME:MAXFLEN,FLEN);
CALL FILE^ERRORS^NAME(FNAME:FLEN,ERROR);
END;
!------------------------------------------------------------
! Procedure to write a message on the terminal and check for
! any error. If there is an error, it attempts to write
! a message about the error and the program is stopped.
!------------------------------------------------------------
PROC WRITE^LINE(BUF,LEN);
STRING .BUF;
INT LEN;
BEGIN
CALL WRITEX(TERMNUM,BUF,LEN);
IF <> THEN CALL FILE^ERRORS(TERMNUM);
END;