![[About]](r:\html\lsrxabout.gif)
![[Toc]](r:\html\lsrxtoc.gif)
0.9b (c) 1995 Peter Childs
The function creates a public or private application.
Syntax
MyRc = NetAdd(NETAPP, 'AppInfo', SrvName) MyRc = NetAdd(NETAPP, 'AppInfo', SrvName, UserId)
Parameters
The parameters required are:
'AppInfo' The REXX variable holding the application information. The
variable is divided into:
o AppInfo.name
The application name
o AppInfo.remark
The application remark or description. A remark must be provided
o AppInfo.command
The command that starts the application
o AppInfo.command_parms
The application start parameters if required
o AppInfo.app_alias_or_drv
The alias or drive where the application resides. It specifies a
drive letter, followed by a colon (:), if the application resides on
the user's local machine or it specifies an existing alias if the
application resides on a server
o AppInfo.app_drive
Applies to DOS public applications only. It is used to specify the
drive that is current when the application runs. Valid letters are A
through X. A value of * indicates that the system should choose a
drive letter
o AppInfo.app_path_to_dir
The remaining path to the application
o AppInfo.wrkdir_alias_or_drv
Specifies the directory that is made current when the application
runs. If the working directory is on the local machine, it specifies
the drive, where the directory is located. If the working directory
is remote, it specifies an existing alias where the directory is
located
o AppInfo.wrkdir_drive
Specifies the drive that the working directory is to be assigned to
when the application is started. For OS/2 applications, this can be
any letter D through Z. For DOS applications, this can be any letter
A through X. A value of * indicates that the system should choose a
drive when the application is started.
o AppInfo.wrkdir_path_to_dir
The remaining path to the working directory
o AppInfo.prompt
Prompt for parameters. The following values can be used:
Prompt for parameters Value
--------------------- -----
Yes 'Prompt user for parameters'
'Yes'
No 'Do not prompt user for parameters'
'No'
The default value is 'No'.
o AppInfo.interface
The interface type. The values can be:
Interface type Value
-------------- -----
Presentation Manager 'Presentation Manager'
'PM'
OS/2 Fullscreen 'Fullscreen'
'FS'
OS/2 Windowed 'Windowed'
'WIN'
The default value is 'Presentation Manager'.
o AppInfo.type
The application type. The following values are used:
Application type Value
---------------- -----
Public DOS 'Public DOS application'
'PUBLIC_DOS'
Public OS/2 'Public OS/2 application'
'PUBLIC_OS2'
Private OS/2 'Private OS/2 application'
'PRIVATE_OS2'
The default value is 'Public OS/2 application'.
o AppInfo.res_count
The number of application resource list entries that follows. A value
of zero indicates that the application does not require any
redirected devices when it runs.
o AppInfo.i.arl_alias
The alias for the resource required by the application. The variable
i must have a value from 1 to AppInfo.res_count
o AppInfo.i.arl_device
The device assigned to the resource specified.
If AppInfo.i.arl_alias specifies a files alias, AppInfo.i.arl_device
must be a drive letter followed by a colon (:). Valid drive letters
for OS/2 applications are D: through Z:. Valid drive letters for DOS
applications are A: through X:.
If AppInfo.i.arl_alias specifies a print alias, valid values are LPT1
through LPT9.
If AppInfo.i.arl_alias specifies a serial device alias, valid values
for AppInfo.i.arl_device are LPT1 through LPT9 and COM1 through COM9.
Additionally, each application resource list entry must have a unique
value for its AppInfo.i.arl_device field. For example, if
AppInfo.i.arl_alias specifies a files alias, the drive letter
specified in the AppInfo.i.arl_device field must be different from
AppInfo.app_drive, AppInfo.wrkdir_drive, and any other
AppInfo.i.arl_device fields for files aliases.
The variable i must have a value from 1 to AppInfo.res_count
SrvName The server computer name of the domain controller
Application The application name
UserId The name of the userid. The name of the userid must be
specified for private applications
Note
The server computer name can be specified as '' for a local domain controller.
Example
/* Add a public application */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs
NETAPP = 30
SrvName = '\\ILIDC'
AppInfo.name = 'BOOKREAD'
AppInfo.remark = 'Shared Bookmanager Read/2'
AppInfo.command = 'BOOKMGR.EXE'
AppInfo.command_parms = ''
AppInfo.app_alias_or_drv = 'BOOKMGR' /* Bookmanager programs alias */
/* AppInfo.app_drive not used */
AppInfo.app_path_to_dir = '\'
AppInfo.wrkdir_alias_or_drv = 'BOOKMGR'
AppInfo.wrkdir_drive = 'R' /* Make R: the working dir */
AppInfo.wrkdir_path_to_dir = '\' /* Remaining path */
AppInfo.prompt = 'Do not prompt user for parameters'
AppInfo.interface = 'Presentation Manager'
AppInfo.type = 'Public OS/2 application'
/* The additional resources */
AppInfo.res_count = 3
AppInfo.1.arl_alias = 'SHAREDLL'
AppInfo.1.arl_device = 'Y:'
AppInfo.2.arl_alias = 'THEBOOK'
AppInfo.2.arl_device = 'Q:'
AppInfo.3.arl_alias = 'PRINTIT'
AppInfo.3.arl_device = 'LPT4'
myRc = NetAdd(NETAPP, 'AppInfo', SrvName)
if myRc <> '0' then do
say 'Got error from NetAdd() ' myRc
call DropLsRxutFuncs
exit 9
end
else do
say 'Application added successfully'
say
end
call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'
exit 0
Example Output
Application added successfully
Inf-HTML End Run - Successful