IBM OS/2 LAN Server REXX Utility DLL


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


NETAPP Enumerate


The function returns the application names of a given type.   
Syntax 

MyRc = NetEnumerate(NETAPP, 'appNames', SrvName)
MyRc = NetEnumerate(NETAPP, 'appNames', SrvName, UserId)
MyRc = NetEnumerate(NETAPP, 'appNames', SrvName, UserId, AppType)

  
Parameters 
The parameters specified are: 
'appNames'    The REXX variable receiving the result. The variable is 
              divided into: 
   o appNames.0 
     The number of application names returned 
   o appNames.i 
     The application name number i, where the variable i has a value from 
     1 to appNames.0. 
   o appNames.totalentries 
     The total number of entries available. If many entries are defined 
     the number of entries returned (appNames.0) is not identical to the 
     total numbers available 
SrvName       The server computer name of the domain controller 
UserId        The Userid is specified for private application. For a list 
              of all public DOS and OS/2 application use 
              NetEnumerate(NETAPP) with 3 parameters. 
AppType       Use this value together with the five parameter call til 
              NetEnumerate() to control the application names returned. 
              The values defined can be added to enumerate a combination 
              of application types. Use a empty value for the UserId 
              parameter to enumerate public applications. The following 
              values are used: 
              Value   Enumerate
              -----   ---------
               1      Public DOS applications
               2      Public OS/2 applications
               4      Private OS/2 applications
               8      Private DOS applications
              
              
MyRc          The return code. You will get the return code 3 if the 
              userid specified for the private applications does not have 
              the domain controller database entries available. See also 
              NETUSERINITDCDB 
  
Note 
The server computer name can be specified as '' for a local domain 
controller.   
Example   

/* List all public applications and private applications for FMAM */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETAPP  = 30
SrvName = '\\DOMAIN_CONTRLR'
UserId  = 'FMAM'

/* Get all public application names */
myRc = NetEnumerate(NETAPP, 'appNames', SrvName)

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

if appNames.0 = 0 then do
 say 'No public applications defined'
end
else do
 say 'Number of public applications: ' appNames.0
 say

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

 say
end

/* Get all private application names for UserId */
myRc = NetEnumerate(NETAPP, 'appNames', SrvName, UserId)

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

if appNames.0 = 0 then do
 say 'No private applications defined for ' UserId
 call DropLsRxutFuncs
 exit 0
end

say 'Number of private applications for ' UserId 'is:' appNames.0
say

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

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit 0

  
Example Output   

Number of public applications:  3

ALLAPPS
LANMSG
THENEW

No private applications defined for  FMAM



Inf-HTML End Run - Successful