Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 65
Writing the Program
! Flush to tape every 10 record blocks. Use modulo
! divide to detect tenth record. Buffered mode is
! already set, therefore SETMODE 99 forces to tape all
! records in tape buffer:
IF $DBL(SEQ^NUM) '\' 10 = 0 THEN
BEGIN
CALL SETMODE(TAPENUM,99,1);
IF <> THEN CALL FILE^ERRORS(TAPENUM);
END;
END;
END
UNTIL NOT (SBUFFER[0] = "y" OR SBUFFER[0] = "Y");
! Turn off buffered mode:
CALL SETMODE(TAPENUM,99,0);
IF <> THEN CALL FILE^ERRORS(TAPENUM);
! Close the tape file:
CALL FILE_CLOSE_(TAPENUM);
END;
!------------------------------------------------------------
! Procedure to stop the program on request. As well as
! stopping the program, this procedure rewinds and unloads
! the tape.
!------------------------------------------------------------
PROC EXIT^PROGRAM;
BEGIN
! Stop the program:
CALL PROCESS_STOP_;
END;