PRINTER CLOSE

PRINTER CLOSE

Top  Previous  Next

 

The PRINTER CLOSE statement closes one or all print units.

 

 

Format

 

PRINTER CLOSE {ON print.unit}

 

where

 

print.unitidentifies the print unit to be closed. If omitted, all print units are closed.

 

 

The PRINTER CLOSE statement terminates activity on a print unit. If this print unit was directed to a spool file, the data will be printed. Any heading and footing text is discarded. Subsequent data sent to the same print unit starts a new output stream. If this is for the default printer, it will be necessary to use PRINTER ON if the output is to be directed to a printer rather than the screen.

 

The implementation of PRINTER CLOSE with no print.unit specified differs on various multivalue database products. By default, in QM a PRINTER CLOSE with no print.unit causes all print units to be closed. The same effect can be achieved by using a print.unit value of -2 though this is not portable to other environments. The PRCLOSE.DEFAULT.0 option of the $MODE compiler directive can be used to modify this behaviour so that only printer zero is closed.

 

All print units are closed automatically on return to the command prompt.

 

 

The PRINTER command has a KEEP.OPEN option which, when used, causes requests from programs to close printers only to terminate the page and discard any heading and footing text. This printer remains open so that subsequent output to the same print unit will be merged to form a single print job.