This operation code retrieves the number of printers installed on a system.
CALL "WIN$PRINTER" USING WINPRINT-GET-NO-PRINTERS, WINPRINT-SELECTION GIVING RESULT
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. 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. 88 WPRT-HAS-NO-COPY VALUE 1. 03 WINPRINT-ORIENTATION SIGNED-SHORT. 88 WPRT-HAS-NO-LANDSCAPE VALUE 0. 88 WPRT-HAS-LANDSCAPE VALUE 1. 03 WINPRINT-QUALITY SIGNED-SHORT. 03 WINPRINT-CURR-ORIENTATION SIGNED-SHORT. 03 WINPRINT-CURR-COPIES SIGNED-SHORT. |
The number returned by this operation will be stored in WINPRINT-NO-OF-PRINTERS.
The number in WINPRINT-NO-OF-PRINTERS may differ depending on the host operating system. On a Windows 98 system, the number in WINPRINT-NO-OF-PRINTERS will represent the number of printers that are attached with a local driver. But in a Windows NT/Windows 2000 environment, the number in WINPRINT-NO-OF-PRINTERS will represent the number of printers that are attached with a local driver and possibly include the number of remote printers with drivers stored on network servers.
This op-code does not alter any of the current printer settings. It is recommended, but not required, that this op-code be executed before the WINPRINT-GET-PRINTER-INFO op-code.