Guardian Programmer's Guide

Table Of Contents
Communicating With Magnetic Tape
Guardian Programmer’s Guide 421922-014
12 - 76
Writing to a Single-File Unlabeled Tape
Appending to the Only File on an Unlabeled Tape
To append to the only file on an unlabeled tape, your program must do the following:
1. Space forward one file. The tape stops immediately after the first EOF mark:
LITERAL SPACE^FWD^FILES = 7,
SPACE^BACK^FILES = 8,
WRITE^EOF = 2;
.
.
NUMBER^OF^FILES := 1;
CALL CONTROL(TAPE^NUM,
SPACE^FWD^FILES,
NUMBER^OF^FILES);
IF <> THEN ...
2. Space backward one file. The tape stops immediately before the same EOF mark:
NUMBER^OF^FILES := 1;
CALL CONTROL(TAPE^NUM,
SPACE^BACK^FILES,
NUMBER^OF^FILES);
IF <> THEN ...
3. Append records to the tape:
WHILE NOT DONE
BEGIN
.
.
CALL WRITEX(TAPE^NUM,
SBUFFER,
WCOUNT);
IF <> THEN ...
.
.
IF <no more to write> THEN DONE = 1;
END;
4. Write two EOF marks to signify the end of the file and the end of the tape:
CALL CONTROL(TAPE^NUM,
WRITE^EOF);
IF <> THEN ...
CALL CONTROL(TAPE^NUM,
WRITE^EOF);
IF <> THEN ...