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

# GENOUT.PUB

GENOUT.PUB is a public program for selecting the output destination. This program is generally called from print programs.

`0110 ENTER DEVICE$, CHANNEL, OUT_COLS, OVRDARCHIVE$, RPTPFX$, FORM_TYPE$, COPIES, PRINT_DEVICE$,PRINT_CHANNEL, LINES, COPY_NAME$[ALL], ALIGNMENT$`

Variable | Description
DEVICE$ | Devices that can be selected. One or more of the following options are valid: E = all P = printer F = file S = Screen R = print preview W = Lotus worksheet output DEVICE$ is set to the alias of the OPENed device upon exit.
CHANNEL | Set to the channel number of the device. If the channel comes in as 123, a WKS file type is added to the list of devices for Lotus output.
OUT_COLS | Number of output columns, usually 80 or 132. OUT_COLS can be changed by GENOUT.PUB based on the device selected. OUT_COLS is set to 0 if no device is OPENed (for example, when End is selected).
OVRDARCHIVE$ | Overrides the normal archive path.
RPTPFX$ | Returns the report prefix.
FORM_TYPE$ | The ID of the Form Type from the OSFRM file
COPIES | Number of copies to be printed (returned to calling program)
PRINT_DEVICE$ | The device name of the printer or device for the output
PRINT_CHANNEL | The channel on which the printer will be opened
LINES | Unused
COPY_NAME$[ALL] | The copy descriptions for the form (returned to calling program)
ALIGNMENT$ | Set to YES if an alignment should be printed; or NO if no alignment is necessary (returned to calling program)

GENOUT.PUB controls output selection, including printer selection, the file name for file output, and screen output. Terminal and printer initialization are performed if necessary. GENSCROL is ADDRed if screen output is selected.

The value of OUTCOLS controls the display of the standard or compressed selection message in the following manner:

- If the printer selected has been set up as a wide-carriage printer in the CONFIG.BBX file, the standard/compress message is always displayed.
- If the printer is defined as an 80-column printer, reports coded as 132 will always be compressed and no message will be displayed. The message is always displayed for reports defined as 80 and for reports sent to the screen.
- If the terminal is capable and is defined correctly in the CONFIG.BBX and termcap files, it will produce compressed output.
- If the compressed-to-screen option for the workstation has been set to Inactive, the user will not be prompted for standard or compressed output. The system will use standard output.
- If the terminal is incapable of producing compressed output but compressed output is selected, processing will continue as if standard output had been selected. Reports that are sent to a file will have OUTCOLS set to 132, and the message will not be displayed. To disable the standard/compressed message on 80-column forms set OUTCOLS=-80, it will be returned as an absolute value to the workspace program.

If a program needs to have multiple outputs, there are some restrictions. For example, if an audit log and an error report need to be produced in the same program, GENOUT.PUB can be called twice. However, if the first call allowed Printer or File to be selected and File was selected, the second selection would not allow file output even though DEVICE$ had been set to "PF". Had the first selection been Printer, that printer's name would be removed from the available printer list, and file output would still be available. If only one printer were defined in the CONFIG.BBX file, printer output would not be displayed.

GENOUT.PUB also determines whether GUI mode is currently active. If so, GENGUOUT.PUB is run from GENOUT.PUB. GENGUOUT.PUB is the graphical version of GENOUT.PUB, and allows for selection of device output, except within a GUI window.