REXX automatically imports several workplace classes and adds them to the global environment. These include:
WPObject
WPTransient
WPAbstract
WPProgram
WPFolder
You can import other workplace classes just as you can import SOM classes, except for Workplace Shell classes the class server is WPS instead of SOM. Here are two ways to import the WPClock class:
::class WPClock external 'WPS WPClock' WPClock = .wps~import('WPClock')
REXX also creates an entry in the environment for one other workplace object, WPDesktop. The other explicitly named system folders can be added to the environment by running the WPSYSOBJ.CMD utility. The REXX folder names followed by their workplace functions are:
WPNoWhere
After calling WPSYSOBJ.CMD, you can refer to the information folder directly by using .wpinfo.
It is easy to locate other items on the desktop using the WPFIND.CMD utility. You can use WPFIND directly from a command line or within a program. From a command line, the syntax is:
wpfind -p name path
The path is the title of a workplace object to locate and place into the global environment name specifies.
From within a program, the syntax is:
obj = wpfind(path)
The path is the title of a workplace object that obj will reference.
The path must always be a string. If you are looking for a folder with the title "Folder2" and know it is inside the folder entitled "Folder1," which resides on the desktop, you can call it as follows:
is_found=wpfind('Folder1;Folder2')
Another way to call WPFIND is to use the folder itself directly. If f1 is the folder entitled "Folder1" and f2 is the folder entitled "Folder2," the call:
is_found = wpfind(f1~wpQueryTitle';'f2~wpQueryTitle)
changes everything in parenthesis to a valid string.
The basic assumption is that the very first folder that using WPFIND searches is .wpDesktop. WPFIND returns the object itself. If the requested object is not found, WPFIND returns the NIL object.
The Workplace documentation frequently uses named constant values. REXX provides the WPCONST.CMD utility to let programmers use the named constants instead of looking up their values. Running WPCONST.CMD sets up a directory called WPCONST in the global environment that contains the names and their values. For example, the OPEN_SETTINGS constant could be referenced as:
.wpconst['OPEN_SETTINGS'].
Note: Use quotation marks around constant names, such as "OPEN_SETTINGS" in the preceding example.