skip to main content

Library Routines : WIN$PRINTER : WINPRINT-GET-PRINTER-INFO-EX

WINPRINT-GET-PRINTER-INFO-EX
The WINPRINT-GET-PRINTER-INFO-EX function retrieves information concerning a specific printer.
Syntax:
 CALL "WIN$PRINTER" USING WINPRINT-GET-PRINTER-INFO-EX 
Parameters:
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.
Note - If no printer is available in the system, set wprterr-no-printers to true before calling this function in order to avoid errors. winprint-curr-copies and winprint-curr-orientation are returned anyway.
Note - If this function is called before WINPRINT-SETUP, it returns only the following information: winprint-name, winprint-no-of-printers, winprint-is-default, and winprint-job-title. All other fields are set to default values that may not match with the current printer settings.
Return code:
returnCode can be any signed numeric data item and provides additional information:
Example:
The following code snippet retrieves information for all installed printers.
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

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left