Guardian Programmer's Guide

Table Of Contents
Using the Sequential Input/Output Procedures
Guardian Programmer’s Guide 421922-014
15 - 36
Writing to a Printer
Writing to a Printer
A program that uses SIO procedures can control or write to a printer in a way similar to
programs that use regular Guardian procedure calls. Such programs can use the
printer control language (PCL) as described in Section 11, Communicating With
Printers, and in the user guide for your printer.
A program can also enable level-3 spooling through SIO. Level-3 spooling uses the
spooler interface procedures to improve performance when writing to a spooler
collector by using buffered I/O. (Refer to the description of the OPEN^FILE procedure
in the Guardian Procedure Calls Reference Manual.)
Communicating with a printer using SIO procedure calls has some differences from
communicating using regular Guardian procedure calls. These differences affect the
following operations:
Moving the printer automatically to the top of the form when you open it
Accessing control functions through the WRITE^FILE procedure instead of the
CONTROL procedure
Issuing PCL commands using the WRITE^FILE procedure
The following paragraphs explain how to perform these operations using SIO
procedure calls.
Opening a Printer and Issuing an Automatic Top of Form
To access a printer using SIO procedures, you must open the printer file using the
OPEN^FILE procedure. By default, the SIO routines position the printer at the top of
the form if it is opened for write access (but not read/write access):
CALL OPEN^FILE(COMMON^FCB,
PFILE);
Use the AUTO^TOF flag in the flags mask without setting the corresponding bit in the
flags p
arameter if you do not want to be automatically moved to the top of the form:
CALL OPEN^FILE(COMMON^FCB,
PFILE,
!block^buffer!,
!block^bufferlen!,
!flags parameter!,
AUTO^TOF);