0.9b (c) 1995 Peter Childs
The function retrieves a list of printer ports on a server or workstation.
Syntax
MyRc = NetEnumerate(NETPRINTPORT, 'prtPortInfo', SrvName)
Parameters
The parameters specified are:
'prtPortInfo' The REXX variable receiving the result. The variable is divided into:
o prtPortInfo.0
The number of printer ports
o prtPortInfo.i
Port name entry i, where the variable i has a value from 1 to prtPortInfo.0
SrvName The server computer name
Note
The server computer name can be specified as '' for a local computer.
Example
/* List printer ports */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTPORT = 300 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETPRINTPORT, 'prtPortInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if prtPortInfo.0 = 0 then do say 'No printer ports available' call DropLsRxutFuncs exit 0 end say 'Number of printer ports defined: ' prtPortInfo.0 say do i=1 to prtPortInfo.0 say prtPortInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0
Example Output
Number of printer ports defined: 8 FILE COM4 COM3 COM2 COM1 LPT3 LPT2 LPT1
Inf-HTML End Run - Successful