Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 37
Accessing EDIT Files
Issuing CONTROL Functions
Use the forms-control-code parameter of the WRITE^FILE procedure to provide
forms control for the printer. This parameter can take any value that is valid for the
second parameter of CONTROL operation 1. You should not, however, try to use the
CONTROL procedure; instead use WRITE^FILE.
The following example issues a form feed before writing the contents of the write buffer
to the file:
LITERAL FORM^FEED = 0;
.
.
CALL WRITE^FILE(PFILE,
BUFFER,
WCOUNT,
!reply^error^code!,
FORM^FEED);
Refer to the Guardian Procedure Calls Reference Manual for a complete list of values
for the second parameter to CONTROL operation 1.
Issuing PCL Commands
You can issue any given PCL command supported by a given printer using the
WRITE^FILE procedure call. You simply supply the appropriate escape sequence in
the write buffer. The following example sets the left and right margins:
WRITE^BUFFER ':=' [%33,"&a99m9L"] -> @S^PTR;
CALL WRITE^FILE(PFILE,
WRITE^BUFFER,
@S^PTR '-' @SWRITE^BUFFER);
Refer to Section 11, Communicating With Printers, for a description of PCL and some
commonly used escape sequences.
Accessing EDIT Files
SIO procedures provide one programmatic way to write to files in EDIT format. The
other way is to use the IOEdit procedures described in Section 14, Using the IOEdit
Procedures.
Using SIO procedures, access to an EDIT file is like access to any other SIO file, with
the following exceptions:
You must open an EDIT file in either read-only or write-only mode; any attempt to
open an EDIT file in read/write mode will fail. In addition, the open must specify a
block buffer.
When reading records in an EDIT file, you can save the current position and return
to it later.
The following paragraphs explain how to perform these operations.