basic.printer

Statement/BASIC Program, Releases: R83 and AP

Toggles crt/Spooler output or closes entry.

Syntax

printer on printer off printer close printer num.expression

Description

controls the output from subsequent 'print', 'heading', 'footing' or 'page' statements.

'printer on' directs output to the system printer, via the Spooler.

'printer off' directs output from subsequent 'print' statements to the terminal.

'printer close' indicates that the current (printer) output is completed. This closes all open Spooler entries generated by the current process, and releases control of the print job(s) to the Spooler. 'printer close' is implicit when the Pick/BASIC program stops and returns to TCL, or the calling PROC or executing program.

'num.expression' evaluates as follows:

-1 'printer close'
0 'printer off'
>=1 'printer on'

See the 'crt' statement for directing output to the terminal while 'printer on' is in effect.

Example

print 'press <return> to begin printing'
printer on
print 'this is the first line'
The first string is displayed, print output is turned on, and the second string
is Sent to the spooler.

crt 'print? ':;input answer
printer (answer='y')
The printer is turned on if the variable 'answer' is the letter
'y'.

printer on
print rec<5>
if rec<6>='' then
printer off
print 'error in attribute 6'
print 'press <return> to continue ':
input continue
printer on
end
This section of program turns off the printer to display an error message and
prompt for operator intervension. When the printer is turned back on, output is
appended to the currently open spooler file.

10 *
print 'do you want to print? ':
input ans
if ans # 'y' then stop
printer on
print 'the amount is ':amount
print ...
....
printer close
printer off
goto 10
In this example, a single section of a larger program sends output to the
Spooler, closes the job when finished, and continues execution of the program.

See Also

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.crt Statement Outputs expression to crt.
basic.page Statement Forces page eject.
basic.print.on Statement Directs output to specific report.
basic.printer.on Statement Directs 'print' statement output to Spooler.
basic.print Statement Outputs expression to printer or crt.
ue.0193 User Exit Move parameter from 'source' buffer to 'destination' buffer.
ue.3193 User Exit Directs all subsequent output to go to the terminal.
ue.61bc User Exit Disables terminal output.
UE.4193 User Exit Terminates output to spooler.
basic.footing Statement Defines report footing.
basic.heading Statement Defines report heading.
basic.printer.off Statement Directs 'print' statement output to crt.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.