You are here: Development Standards > Routines > General Routines > GENPRNT.PUB

# GENPRNT.PUB

GENPRNT.PUB is a public program for displaying the available printer selections as configured in the user's CONFIG.BBX file, except device PF, which is used to print to a file. GENPRNT.PUB is generally called by GENOUT.PUB. This program has two main areas: searching the CONFIG.BBX file for printers and the actual selection process.

`XXXX ENTER P_DEVICE$,P_CHANNEL,PREVIEW`

Variable | Description
P_DEVICE$ | Set to the printer selected
P_CHANNEL | Set to the channel number of the selected printer
PREVIEW | Set to 1 if Print Preview is selected, or 0 if not

Exit Points | Explanation
EXIT | GENPRNT.PUB does not return an error code.

The TSK() function is used to find out which devices are delivered in the CONFIG.BBX file. If the first character is P or L, the device name (except PF) is stored in the string array PRINTER$(1:1:3) and appears in a window.

If this workstation has a default printer, the printer choice is set to this default. If there is only one valid printer, the user is not asked to choose it. The printer selection uses GENINPUT.PUB. After a valid printer choice is made, the printer channel is OPENed and control returns to the CALLing program.