CALL "WIN$PRINTER" USING WINPRINT-GET-PRINTER-INFO-EX                            WINPRINT-SELECTION                    GIVING returnCode  | 
WINPRINT-GET-PRINTER-INFO-EX  | Constant  | |
WINPRINT-SELECTION  | Group Item  | Structure that receives the information. This group item, defined in isprint.def, has the following structure:  | 
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.        88 wprterr-no-printers    value -1.     03 winprint-is-default       signed-short.        88 wprt-is-not-default    value 0.        88 wprt-is-default        value 1.     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.        88 wprt-has-no-color      value 0.        88 wprt-has-color         value 1.     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.        88 wprt-monochrome        value 0.        88 wprt-color             value 1.     03 winprint-job-title        pic x(80).  | ||
Note - members not mentioned below are not used by this function.  | ||
winprint-name It is the name of the printer. When the function is called and winprint-no-of-printers is zero, the function searches for a printer with the name specified. Otherwise, it receives the name of the printer identified by winprint-no-of-printers.  | ||
winprint-no-of-printers It is the number of the printer information is retrieved for. When this member is zero, the function searches for a printer with the name specified in winprint-name.  | ||
winprint-is-default It is a flag indicating if the printer is the system's default printer. If it is the default printer, the wprt-is-default condition is set to true, otherwise the wprt-is-not-default is set to true.  | ||
winprint-curr-copies Is the number of copies the printer will print with the next job.  | ||
winprint-color It is a flag indicating if the printer supports colors. If color is supported, the wprt-has-color condition is set to true, otherwise the wprt-has-no-color is set to true.  | ||
winprint-curr-orientation Is the current orientation: portrait or landscape.  | ||
winprint-curr-collate Is the current collate state.  | ||
winprint-curr-duplex Is the current duplex setting: simplex, vertical or horizontal.  | ||
winprint-curr-papersize Is the current paper-size. See List of supported papersizes for a list of possible values.  | ||
winprint-curr-tray Is the current tray. Possible values are defined in isprint.def. Note - this field is not supported under Java 17.  | ||
winprint-curr-color It is a flag indicating if the printer is properly set to print colors. If it is properly set, the wprt-color condition is set to true, otherwise the wprt-monochrome is set to true.  | ||
winprint-job-title It is the name of the printer job.  | ||
1   | Operation successful.  | 
WPRTERR-UNSUPPORTED  | The WIN$PRINTER library routine is not supported.  | 
WPRTERR-BAD-ARG  | The WIN$PRINTER library routine has been called with bad parameters.  | 
call "WIN$PRINTER" using WINPRINT-GET-NO-PRINTERS, winprint-selection move winprint-no-of-printers to printerCount perform varying printerIdx from 1 by 1 until printerIdx > printerCount    initialize winprint-selection    move printerIdx to winprint-no-of-printers    call "WIN$PRINTER" using WINPRINT-GET-PRINTER-INFO-EX, winprint-selection    display "Printer name: " winprint-name end-perform  |