WINPRINT-SET-PRINTER-EX

This operation code allows you to select a specific printer and set properties, extending the functionality of WINPRINT-SET-PRINTER.

Usage

CALL "WIN$PRINTER"
    USING WINPRINT-SET-PRINTER-EX, WINPRINT-SELECTION

Parameters

WINPRINT-SELECTION Group item defined in winprint.def as follows:
01  WINPRINT-SELECTION.
   03 WINPRINT-NAME                    PIC X(80).
   03 WINPRINT-PORT                    PIC X(80).
   03 WINPRINT-DRIVER                  PIC X(80).
   03 WINPRINT-DRV-VERSION             SIGNED-INT.
   03 WINPRINT-NO-OF-PRINTERS          SIGNED-SHORT.
   03 WINPRINT-IS-DEFAULT              SIGNED-SHORT.
   03 WINPRINT-COPIES                  SIGNED-SHORT.
   03 WINPRINT-ORIENTATION             SIGNED-SHORT.
   03 WINPRINT-QUALITY                 SIGNED-SHORT.
   03 WINPRINT-CURR-ORIENTATION        SIGNED-SHORT.
   03 WINPRINT-CURR-COPIES             SIGNED-SHORT.
   03 WINPRINT-DUPLEX                  SIGNED-SHORT.
   03 WINPRINT-COLLATE                 SIGNED-SHORT.
   03 WINPRINT-COLOR                   SIGNED-SHORT.
   03 WINPRINT-CURR-DUPLEX             SIGNED-SHORT.
   03 WINPRINT-CURR-COLLATE            SIGNED-SHORT.
   03 WINPRINT-CURR-PAPERSIZE          SIGNED-SHORT.
   03 WINPRINT-CURR-TRAY               SIGNED-SHORT.
   03 WINPRINT-CURR-COLOR              SIGNED-SHORT.
   03 WINPRINT-JOB-TITLE               PIC X(80).

This group item has numerous conditional variables. See winprint.def for the complete list.

Description

The printer may be open or closed to perform these functions. There is no need to reset any of these functions. WINPRINT-SELECTION should be initialized prior to use. WINPRINT-SET-PRINTER-EX has all the same values as WINPRINT-SET-PRINTER plus the following additional values:

WINPRINT-CURR-DUPLEX If WINPRINT-DUPLEX is set to a positive value greater than one, you may set this to one of the following values:
  • WPRT-SIMPLEX
  • WPRT-DUPLEX-VERTICAL
  • WPRT-DUPLEX-HORIZONTAL
WINPRINT-CURR-COLLATE If WINPRINT-COLLATE is set to a positive value greater than one, you may use WINPRINT-CURR-COLLATE to turn collating on or off.
WINPRINT-CURR-PAPERSIZE Because of the huge variety of paper sizes supported by different printers, this can be set to any value. Values less than 42 should correspond to the PAPER-SIZES table in winprint.def. Values greater than 255 are user defined. The runtime accepts any value, no validation is performed.
WINPRINT-CURR-TRAY Because of the huge variety of paper trays supported by different printers, this can be set to any value. Values less than 16 should correspond to the PAPER-TRAYS table in winprint.def. Values greater than 15 and less than 256 are undefined. Values greater than 255 are device specific. The runtime accepts any value, no validation is performed.

Values 12 and 13 are not defined in the PAPER-TRAYS table in winprint.def. This matches a similar gap in the Windows API. Refer to prndemox.cbl for an example of how to compensate for these undefined values.

WINPRINT-CURR-COLOR If WINPRINT-COLOR is set to a positive value greater than one, you may use this to turn color printing on or off.
Note: When using one of these extended operations, it is best to pair it with a corresponding extended operation. For example, use WINPRINT-GET-CURRENT-INFO-EX with WINPRINT-SET-PRINTER-EX, instead of with WINPRINT-SET-PRINTER.