SET PRINTER
Topic group Related topics Example
The SET PRINTER TO setting specifies a file to receive streaming output, or uses a device code recognized by the Windows Print Manager to designate a printer. The On/Off setting controls whether dBASE Plus also directs streaming output that appears in the Command window to the device or file specified by SET PRINTER TO.
Syntax
SET PRINTER on | OFF
SET PRINTER TO [<filename> | ? | <filename skeleton>] | [<device>]
<filename> | ? | <filename skeleton>
The text file to send output to instead of the printer. By default, dBASE Plus assigns a .PRT extension to <filename> and saves the file in the current directory. The ? and <filename skeleton> options display a dialog box, in which you specify the name of the target file and the directory to save it in.
<device>
The printer port of the printer to send output to. Specify printers and their ports with the Windows Control Panel.
Default
The default for SET PRINTER is OFF. To change the default, set the PRINT parameter in the [OnOffCommandSettings] section in PLUS.ini. The default for SET PRINTER TO is the default printer you specify with the Windows Control Panel.
Description
Use SET PRINTER TO to direct streaming output from commands such as ?, ??, and LIST to a printer or a text file. SET PRINTER TO with no option sends this output to the default printer.
Use SET PRINTER ON/OFF to enable or disable the printer you specify with SET PRINTER TO.
To send streaming output to a file rather than the printer, issue SET PRINTER TO FILE <filename>. When you issue SET PRINTER TO FILE <filename>, issuing SET PRINTER ON directs streaming output to the text file <filename> rather than to the printer. The file has the default extension of .PRT.
When SET PRINTER is OFF, dBASE Plus directs streaming output only to the result pane of the Command window. SET PRINTER must be ON to output data to a text file unless you issue a command with its TO PRINTER option. The following example illustrates this behavior:
set printer off
set printer to file test.prt
type file.txt // displays on screen only
type file.txt to print // output sent to screen and test.prt