Guardian Programmer's Guide

Table Of Contents
Using the IOEdit Procedures
Guardian Programmer’s Guide 421922-014
14 - 11
Reading and Writing an IOEdit File
Reading and Writing an IOEdit File
This subsection discusses some of the operations you can perform that relate to I/O
with EDIT files. Specifically, it covers how to perform the following operations:
Set the starting point for a sequential I/O operation using the POSITIONEDIT,
READEDIT, or WRITEEDIT procedure.
Perform sequential reading.
Perform sequential writing, including how to append lines to the end of a file, how
to insert lines into a file, and how to handle error 45, the File Full error.
Delete lines from a file.
Renumber lines in a file.
Set and get the record number increment.
Perform line backspacing, as required to support the FORTRAN BACKSPACE
statement.
Record Pointers
Like the Enscribe database record manager, IOEdit makes use of current-record and
next-record pointers when performing I/O with EDIT files.
The current-record pointer points to the record that the last I/O operation accessed;
that is, the last record read, the last record written to, or the record that precedes a set
of deleted records.
The next-record pointer points to the record that the next operation will be performed
on. For a read operation, the next record is the record in the file that immediately
follows the current record. For a write operation, the next record number is the current
record number plus the current record number increment. The record number
increment is explained later in this subsection.
In addition to record numbers that relate to line numbers as described earlier in this
section, there are some special values for a record number, as shown in Table 14-4:
Table 14-4. Record Numbers
Number Explanation
-1 The lowest-numbered line in the file
-2 The highest-numbered line in the file
-3 or
un
specified
The current record as indicated by the last I/O operation
0 or greater The desired line number times 1000