# PRINTER

Updated: 10/14/2021, 2:20:00 PM
Created: 10/14/2021, 2:20:00 PM
Last Updated By: mikes
Read Time: 1 minute(s)

# Description

Use the PRINTER statement to control the destination of output from the PRINT statement. It takes the general form:

PRINTER ON|OFF|CLOSE {ON <printernumber>}
1

Where:

PRINTER ON redirects all subsequent output from the PRINT statement to the print spooler.

PRINTER OFF redirects all subsequent output from the PRINT statement to the terminal device.

PRINTER CLOSE will act as PRINTER OFF but in addition closes the currently active spool job created by the active PRINTER ON statement.

The following code sample demonstrates the use of the statement.

PRINTER ON;* Open a spool job

FOR I = 1 TO 60
    PRINT "Line ":I ;* Send to printer
    PRINTER OFF
    PRINT "+": ;* Send to terminal
    PRINTER ON ;* Back to printer
NEXT I

PRINTER CLOSE ;* Allow spooler to print it
1
2
3
4
5
6
7
8
9
10

Go back to jBASE BASIC

Go back to Programmers' Reference Guide