isCOBOL Evolve : Appendices : Library Routines : WIN$PRINTER : WINPRINT-GET-CURRENT-INFO-EX
WINPRINT-GET-CURRENT-INFO-EX
The WINPRINT-GET-CURRENT-INFO-EX function retrieves information concerning the currently selected printer.
Syntax:
 CALL "WIN$PRINTER" USING WINPRINT-GET-CURRENT-INFO-EX
                          WINPRINT-SELECTION
                   GIVING returnCode
Parameters:
WINPRINT-GET-CURRENT-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
 
winprint-no-of-printers
It is the number of the currently selected printer in the isCOBOL framework.
 
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-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-copies
Is the number of copies the printer will print with the next job.
 
winprint-curr-orientation
Is the current orientation: portrait or landscape.
 
winprint-curr-duplex
Is the current duplex: simplex, vertical or horizontal.
 
winprint-curr-collate
Is the current collate state.
 
winprint-curr-papersize
Is the current paper-size. Due to Java implementation, the value 9 is always returned.
 
winprint-curr-tray
Is the current tray. Possible values are defined in isprint.def.
 
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 current job.
 
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:
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.