SET PRINTER Command

Enables or disables output to the printer or routes output to a file, port, or network printer. There are several versions of the syntax.

Tip

To direct output to a file, a port for a different local printer, or a network printer, use SET PRINTER TO with the specified arguments. To reset output to the default MS-DOS PRN print utility, use SET PRINTER TO without arguments.

Parameters

ON [PROMPT]

Enables output to the printer.

PROMPT displays the Print dialog box before printing starts. In the Print dialog box, you can adjust printer settings. The currently installed printer driver determines which printer settings you can adjust.

Note

When SET PRINTER is set to ON, output formatted with the @ ... SAY command is not routed to the printer. To direct output from @ ... SAY to the printer, use the SET DEVICE TO PRINTER command. For more information, see SET DEVICE Command.

OFF

Disables output to the printer. (Default)

FONT cFontName[, cFontSize [, nFontCharSet]]

Specifies a default font for printer output. cFontName specifies the name of the font, and cFontSize specifies the point size. You can specify a language script with nFontCharSet. See the GETFONT( ) Function for a list of available language script values.

For example, the following command specifies 16-point Courier font as the default printer font:

If the font you specify is not available, a font with similar font characteristics is substituted.

STYLE cFontStyle

Specifies a default font style for printer output. If you omit the STYLE clause, the normal font style is used. If the font style you specify is not available, a font style with similar characteristics is substituted.

The following table lists font styles you can specify with cFontStyle.

cFontStyle

Font style

B

Bold

I

Italic

N

Normal

O

Outline

Q

Opaque

S

Shadow

–

Strikeout

T

Transparent

U

Underline

You can include more than one character to specify a combination of font styles. For example, the following command specifies 16-point Courier Bold Italic:

When you direct output to a network printer, output prints or collects in a print spooler until a new SET PRINTER command is issued. For additional information about printing on your network, consult your network documentation.

Note

This command does not function in Unattended Server Mode.

You can use the GETPRINTER( ) or APRINTERS( ) functions to determine the names of the currently installed printers. For example, the following command displays the Windows Printer dialog box and makes the printer you select the printer to which printed output is directed: