Guardian Programmer's Guide

Table Of Contents
Using the IOEdit Procedures
Guardian Programmer’s Guide 421922-014
14 - 7
The EDIT File Segment
As an example, consider the following text line from a program source file (the pound
signs, #, represent blanks):
###CALL#FILE_OPEN_(FILE^NAME,FILE^NUM);#######!opens#the#file
The corresponding packed form contains seven line segments and a line header byte
as follows:
The EDIT File Segment
IOEdit uses a set of data structures in its own extended data segment known as the
EDIT file segment (EFS), which is analogous to the PFS used by the file system. This
storage area contains buffers that allow the IOEdit routines to read complete pages of
text from disk, perform read-ahead operations, and buffer output to the text file. In
addition to improving performance, this method also removes the need to use space in
the user data segment.
The EDIT file segment is automatically created when you issue an INITIALIZEEDIT
procedure call. This call is implied when you open an EDIT file with the OPENEDIT_
procedure. On opening your first EDIT file, you therefore automatically create the EFS.
On subsequent opens, you initialize data structures within the EFS for the new file.
IOEdit and Errors
When testing for errors following calls to IOEdit procedures, you need test only for
positive errors. IOEdit repairs the file following any negative errors. If you want to
handle damaged files directly, for example by sending a message to the user, you can
test for a negative error.
VST079.VSD