IBM OS/2 LAN Server REXX Utility DLL


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


NETPRINTQUEUE Enumerate


The function returns a list of print queues.   
Syntax 

MyRc = NetEnumerate(NETPRINTQUEUE, 'printQInfo', SrvName)

  
Parameters 
The parameters specified are: 
'printQInfo'      The REXX variable receiving the result. The variable is 
                  divided into: 
   o printQInfo.0 
     The number of print queues 
   o printQInfo.i 
     The print queue name entry i, where the variable i has a value from 1 
     to printQInfo.0 
SrvName           The server computer name 
  
Note 
The server computer name can be specified as '' for a local server or 
computer. 
Example   

/* List print queue names */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETPRINTQUEUE = 120
SrvName       = '\\DOMAIN_CONTRLR'

myRc = NetEnumerate(NETPRINTQUEUE, 'printQInfo', SrvName)

if myRc <> '0' then do
 say 'Got error from NetEnumerate() ' myRc
 call DropLsRxutFuncs
 exit 9
end

if printQInfo.0 = 0 then do
 say 'No printer queues defined'
 call DropLsRxutFuncs
 exit 0
end

say 'Number of printer queue names: ' printQInfo.0
say

do i=1 to printQInfo.0
 say printQInfo.i
end

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit 0

  
Example Output   

Number of printer queue names:  6

LPT1Q
PS203
PCL203
PS202
PCL202
IBM4029



Inf-HTML End Run - Successful