REXX provides access to several OS/2 APIs via the the RexxUtil functions which have been added to OS/2 V2.0. To use these new functions in a REXX program, SysLoadFuncs must be called to automatically load all RexxUtil functions as follows:
/* Rexx program that uses RexxUtil functions */ call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call SysLoadFuncs
RexxUtil functions are prefixed with "Sys". For a complete list of Sys* functions please refer to the OS/2 2.0 Programming Guide Volume II. In WPS development the following Sys* commands are most frequently used:
The following syntax descriptions should help explain what these REXX functions do:
Function: SysRegisterObjectClass Purpose: Register a new object class definition to the system. Syntax: result = SysRegisterObjectClass(classname, modulename) classname The name of the new object class. modulename The name of the module containing the object definition. result The return code from WinRegisterObjectClass. This returns 1 (TRUE) if the class was registered or 0 (FALSE) if the new class was not registered. Function: SysDeregisterObjectClass Purpose: Deregister an object class definition from the system. Syntax: result = SysDeregisterObjectClass(classname) classname The name of the object class to deregister. result The return code from WinDeregisterObjectClass. This returns 1 (TRUE) if the class was deregistered or 0 (FALSE) if the class was not deregistered. Function: SysCreateObject Purpose: Create a new instance of an object class. Syntax: result = SysCreateObject(classname, title, location <,setup>) classname The name of the object class. title The object title. location The object location. This can be specified as either a descriptive path (for example, OS/2 System Folder\System Configuration) or a file system path (for example, C:\bin\mytools). setup A WinCreateObject setup string. result The return code from WinCreateObject. This returns 1 (TRUE) if the object was created or 0 (FALSE) if the object was not created.