═══ 1. Introduction ═══ About... Installation REXX Registration REXX Deregistration REXX Registration Tips ═══ 1.1. About... ═══ This is version 1.9 of RxExtras, released in February, 1994. RxExtras is a set of functions to enhance OS/2's REXX programming language, and is accompanied by additional functions to be used by other PM Rexx-based software (VisPro/Rexx and VX-Rexx, among others). Some of the functions provided by RxExtras can be accomplished by various other means using "pure" OS/2 REXX code, but RxExtras provides an easier interface and more efficient processing. Take the RxSort() function as an example. You can certainly write REXX code to write a stem to a file, run the external SORT program, and read the sorted data back into a stem. The RxSort() function of RxExtras saves a lot of disk I/O; 1. writing the stem to disk. 2. the SORT program reading the file from disk. 3. the SORT program writing the file back to disk. 4. reading the sorted file back into a stem. Plus, with RxSort(), you only need 1 line of code to accomplish the entire task! Once RxExtras is registered to your REXX interpreter, you can take advantage of any RxExtras functions in your existing and future REXX-based programs. ═══ 1.2. Installation ═══ To install RxExtras, place the RxExtras.DLL file in any subdirectory which is part of your LIBPATH statement (LIBPATH is found in your CONFIG.SYS file). For example, you could place RxExtras.DLL in your x:\OS2\DLL subdirectory (by default, x:\OS2\DLL is part of your LIBPATH when you install OS/2). However, it is recommended that you place RxExtras.DLL in some other subdirectory. The reason for this is that should you have to reinstall OS/2, RxExtras.DLL will not automatically be reinstalled with OS/2. All REXX-based programs that require RxExtras.DLL will fail until such time as you manually copy RxExtras.DLL to your x:\OS2\DLL subdirectory. A better, more flexible approach is to make a subdirectory (preferably on a drive other than where OS/2 is installed) for all your add-on *.DLL files, which includes RxExtras.DLL. For example, make a subdirectory called y:\USER\DLL and place RxExtras.DLL in there. Then, edit your CONFIG.SYS file, and add ";y:\USER\DLL" to the end of your LIBPATH. Save CONFIG.SYS and reboot (you must reboot in order for this last change to take effect). Once you've done this, you will never have to modify CONFIG.SYS again, no matter what *.DLL file you add to your system. Just place your new *.DLL file in y:\USER\DLL, and the system will automatically find it when needed. After installing RxExtras, you must register the APIs in order to use them. ═══ 1.3. Registering RxExtras ═══ In order to use any REXX features of OS/2, you must have installed the REXX Interpreter. When you installed OS/2, you may have chosen to not install REXX. If this is the case, open your Selective Install icon and install REXX before continuing. In order to take advantage of RxExtras' REXX APIs found in RxExtras.DLL, you must first "register" the APIs with OS/2's REXX Interpreter. This is true of any and all REXX-based *.DLL files. The process is rather simple. In your *.CMD file (or within your PM REXX-Based program), simply code these 2 lines: Call RxFuncAdd 'RxExtra', 'RxExtras', 'RxExtra' Call RxExtra 'Load' Note: You must code these 2 lines so that they execute before any RxExtras APIs are referenced elsewhere in your program. Once you have done this, your REXX program can take full advantage of RxExtras' APIs (functions). Additionally, all future sessions of REXX-based programs will likewise have access to the RxExtras APIs. In other words, once these APIs are registered, they have a global effect across your entire system; all OS/2 REXX sessions will be able to use them. They stay registered until you reboot or intentionally deregister them. Double-click here for some tips and advice on REXX API registration techniques. ═══ 1.4. Deregistering RxExtras ═══ When you are through with the RxExtras APIs, it is possible to deregister them from your system. The advantage to doing this is that the shared memory they occupied will be released for other programs to use. The disadvantage is that if you wish to use the APIs once more, they must be registered once more. This requires some disk I/O activity to locate the RxExtras.DLL file and load its contents into memory. Warning: If you chose to deregister the RxExtras APIs the affect is global across your entire system. No other REXX-based programs will have access to the APIs and they will in all likelihood fail miserably! To deregister the RxExtras APIs, simply code this line anywhere in any *.CMD file or any other REXX-based program: Call RxExtra 'Drop' Upon execution of the above line, the APIs will be flushed from memory when the system finds it convenient so to do. Double-click here for some tips and advice on REXX API registration techniques. ═══ 1.5. Registration Tips ═══ A good technique for registering any and all REXX API packages (including RxExtras) is as follows: o Define a STARTUP.CMD file in the root directory of your OS/2 boot drive. o Register, within STARTUP.CMD, any and all REXX API packages that you frequently use. o In each *.CMD file or REXX-based program that requires the API: 1. Test for the pre-registration of the API package and save the results in a REXX variable. 2. If the test indicates that the API is not yet registered with REXX, then register it according to the API package's instructions. 3. Just before exiting your program, if the status variable shows that the API was not pre-registered, then deregister it. This method ensures that: 1. Your *.CMD or REXX-based program has access to the APIs it requires. 2. Your REXX environment, in terms of the pre-registered APIs, is restored to its native state before your program exits. This makes for a very well behaved, tolerant program. Specifically, for RxExtras: In your x:\STARTUP.CMD file, place: Call RxFuncAdd 'RxExtra', 'RxExtras', 'RxExtra' Call RxExtra 'Load' In all of your *.CMD and other REXX-based programs that require the RxExtras APIs, place: RxExtraAPI = RxFuncQuery('RxExtra') If RxExtraAPI \= 0 Then Do Call RxFuncAdd 'RxExtra', 'RxExtras', 'RxExtra' Call RxExtra 'Load' End before any other references to RxExtras APIs, and then just before your program exits, use: If RxExtraAPI \= 0 Then Call RxExtra 'Drop' Notice that registering your RxExtras APIs in the STARTUP.CMD file makes the need for the per-program test of pre-registration superfluous. However, it is a good programming practice to code these lines anyway. One reason is that if you give a copy of your program to someone else to use, they might not have registered the APIs in their STARTUP.CMD file. Another reason is that since registration in STARTUP.CMD puts these APIs in memory and leaves them there, you may decide (in the interest of saving memory) to remove the pre-registration from STARTUP.CMD. If you do, and you did not code the above tests (or you got a program from someone else and they did not code the above tests), your programs will no longer execute. CAUTION: Never blindly assume you can deregister any API functions when your program exits. A program that always deregisters the APIs when it quits only causes problems for everyone that uses it. If you are going to include code that deregisters an API (RxExtras or otherwise), you should do so only if you're certain it was not pre-registered when the program started! ═══ 2. RxExtras Release Information ═══ About... Release 1.9 Release 1.8 Release 1.7 Release 1.6 Release 1.5 Release 1.4 Release 1.3 Release 1.2 Previous Releases ═══ 2.1. About... ═══ This section has details on what is, or was, in each release of RxExtras. You can determine the current release level of RxExtras by running the RxExtra function when you are first registering RxExtras to REXX. Double click on any of the releases on the left hand side to see information pertaining to a particular release. The sort of information that is displayed will be a list of functions added, and any other miscellaneous work, such as parameter checking, or multiple threaded-ness. ═══ 2.2. Release 1.9 ═══ The following functions were added in Release 1.9 of RxExtras:- o RxKillProcess o RxSetFileHandles o RxAddFileHandles o RxMatchWildCard These functions were all provided by Leshek Fiedorowicz, along with an update to the RXEXTRAS.CMD file. The help and VisPro/REXX object were done by dIon. All functions that use window handles were improved so that VX-REXX HWnd's could be passed in directly. RxSort was improved so that you can sort a stem only on certain columns within that stem. VX-REXX Insert Code support was added, in the form of the RxExtras.MTC file. ═══ 2.3. Release 1.8 ═══ The following functions were added in Release 1.8 of RxExtras:- o RxFileExists o RxWindowQueryText A bug with RxStemCopy was fixed. It was unnecessarily using up memory. VisPro/REXX v2.0 support was added in the form of an object for the toolbar which held all RxExtras calls and generated code using the VisPro/REXX drag and drop event tree. See VPRxx toolbar object for more details. ═══ 2.4. Release 1.7 ═══ The following functions were added in Release 1.7 of RxExtras:- o RxWindowSetFocus o RxWindowSetOwner Also, more code was added to support VX-REXX, and VX-REXX samples were added to this INF file. ═══ 2.5. Release 1.6 ═══ The following functions were added in Release 1.6 of RxExtras:- o RxNap o RxEventCreate o RxEventDestroy o RxEventOccured o RxEventWaitFor o RxEventQuery o RxEventReset o RxResourceCreate o RxResourceDestroy o RxResourceQuery o RxResourceRelease o RxResourceRequest The tables showing which function were for use with VX-REXX, VisPro/REXX and 'plain' REXX (at the top of each API definition) were updated to be correct. The introduction was updated to reflect the correct version of RxExtras ═══ 2.6. Release 1.5 ═══ The following functions were added in Release 1.5 of RxExtras:- o RxListBoxItemHandle o RxQueueList o RxQueueSetDefault o RxQueueJobProperties o RxQueueWriteStem ═══ 2.7. Release 1.4 ═══ The following functions were added in Release 1.4 of RxExtras:- o RxSetIcon o RxDrawBitmap o RxSetClipboardText o RxQueryClipboardText o RxAppendClipboardText o RxScrollListBox o RxGetEXEName The RxSetGlobal function was enhanced to accept valid REXX variable names and support one call setting of global stems. The RxGetGlobal function was enhanced to accept valid REXX variable names. Note: You can not get global stems in one call using RxGetGlobal. Also, the complete User's Guide you are now reading was included in the package to replace the RxExtras.DOC, and RxExtras.VPR files. Many thanks to Ric Naff for doing a lot of the work. ═══ 2.8. Release 1.3 ═══ The following functions were added in release 1.3 of RxExtras:- o RxThread o RxKillThread o RxSuspendThread o RxResumeThread o RxChangeThreadPriority o RxSetThreadClass ═══ 2.9. Release 1.2 ═══ The following function was added in Release 1.2 of RxExtras:- o RxQueryClassName Also the following miscellaneous work was completed:- o A First cut INF file was included in the ZIP file. o Parameter checking for all functions was enhanced. o RxListBoxFromFile was made multithreaded. o RxVarDump now dumps to a stem, rather than to STDOUT. o RxExtra now returns the version number of RxExtras you have loaded or dropped. o RxVolumeLabel returns an error message if the drive tried is not valid. o RxSwitchTo will match on any part of the string, not just a prefix. o RxQueryDriveType will return "NOTREADY" for CDAUDIO or empty floppy drives. ═══ 2.10. Previously available (No release numbers) ═══ The following functions were available in previous releases of RxExtras that had no release number :- o RxMaximize o RxMinimize o RxRestore o RxBootDrive o RxRead o RxWrite o RxVolumeLabel o RxVarDump o RxStemCopy o RxExtra o RxSort o RxSwitchTo o RxQuerySwitchList o RxQueryDriveType o RxSearchPath o RxSetGlobal o RxGetGlobal o RxLineCount o RxListBoxFromFile o RxListBoxToFile o RxListBoxFromStem o RxListBoxToStem o RxGetListBoxCount o RxGetItemFromListBox o RxGetItemFromListBoxAtIndex o RxAddItemAtIndex o RxSetSpinButtonCharRange o RxSetSpinButtonRangeFromStem o RxSetSpinButtonRangeWithIncrement o RxMorphButtonToIcon o RxSearchItem o RxQueryWindow ═══ 3. VPRxx - VisPro/REXX toolbar support. ═══ A new object for the VisPro/REXX toolbar (VPRxx) was uploaded to the HockWare section of CompuServe. When installed, it places a new object on the VisPro/REXX toolbar that represents RxExtras. If you place this object on your form, you can use it in the event tree view to get prototypes of all the RxExtras functions by dragging the object to the code window. This means RxExtras is now easier to use! And the online help for all the functions are available using the Help button of the Create Link dialog of the RxExtras object. If you have any suggestions, or are interested in other VisPro/REXX objects, contact the author of RxExtras. ═══ 4. VX-REXX Insert Code... Support ═══ When coding using Watcom's section editor, you can use a popup menu to insert commonly used code into your application. You can add the RxExtras APIs to the Insert Code dialog if you wish to do so, by simply copying the RxExtras.MTC file that comes with RxExtras to the \VXREXX\SYSTEM directory. Once the copy has been done, you can use the Insert Code menu item to get prompted (and help assisted) support for coding RxExtras APIs in VX-REXX. If youn have any suggestions for this feature, please contact the author of RxExtras. ═══ 5. RxExtras APIs ═══ The listings for RxExtras APIs (functions) will designate which types of REXX programs can take advantage of them. Each API will have a box at the top of its description detailing in which environments it may be used: ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ If you see "OS/2 REXX" in the above box for a function, you may use that RxExtras function in any *.CMD and/or other REXX-based program. If you do not see "OS/2 REXX", then you cannot use the API in a *.CMD file. If you see "VisPro/REXX" in the above box for a function, you may use that RxExtras function in any VisPro/REXX program. If you see "VX-REXX" in the above box for a function, you may use that RxExtras function in any VX-REXX program. APIs for VisPro/REXX and/or VX-REXX could possibly be used in other PM Rexx-based programs. Some experimentation may be necessary. ═══ 5.1. Disc/File ═══ These APIs deal with accessing information to, from, or about discs and files. Some of them are unique in that there are no standard REXX commands that will retrieve the information for you; RxExtras must be used in these instances. ═══ 5.1.1. RxBootDrive ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXBOOTDRIVE()─── Returns the drive from which OS2 was booted in the format 'X'. If you want a trailing ':' you must append one to the returned drive letter. Example: SAY 'My Boot Drive is' RxBootDrive() || ':' Output: My Boot Drive is C: /* perhaps */ ═══ 5.1.2. RxLineCount ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXLINECOUNT(─┬────────┬─┬────────────┬──filename─)─── └─drive:─┘ └─\─┬───────┬┘ └─path\─┘ Returns the number of lines in filename. The lines in filename are assumed to be delimited by CR/LF characters. If filename does not exist, RXLINECOUNT raises an 'Incorrect call to routine' condition. Example: SAY 'There are' RxLineCount('C:\CONFIG.SYS') 'lines in Config.Sys.' Output: There are 117 lines in Config.Sys. /* perhaps */ ═══ 5.1.3. RxListBoxFromFile ═══ ═══ 5.1.4. RxListBoxToFile ═══ ═══ 5.1.5. RxQueryDriveType ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUERYDRIVETYPE(drive:)─── Returns 'HPFS', 'FAT' or 'CDFS' for their respective drive types. Returns 'NOTREADY' for the following conditions: o A CD-ROM drive with an Audio CD loaded. o An empty floppy drive. o An invalid drive letter. Example: SAY 'Drive C: is a' RxQueryDriveType('C:') 'drive.' Output: Drive C: is a HPFS drive. /* perhaps */ ═══ 5.1.6. RxRead ═══ ═══ 5.1.7. RxSearchPath ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘  ───RXSEARCHPATH(──searchpath──,─┬─────────┬──filename─)─── └─subdir\─┘ Searches for [ subdir\ ]filename in the path(s) defined by searchpath. The path(s) defined for searchpath will be used for the search. searchpath may be composed of several pathnames, each separated by a semicolon. Each pathname is allowed to have either a drive designator, a directory designator, or both. Currently, filename must specify a complete filename; no wildcard characters are accepted. If you supply the optional subdir\ qualifier, the effect is as if you had modified all the values of searchparh to include the addtional subdir\ value. For example, if searchpath contains 'F:\OS2;G:\USER', and you specify 'DLL\' for subdir,, the effect is the same as having specified 'F:\OS2\DLL;G:\USER\DLL' for searchpath and no value for subdir\. RXSEARCHPATH returns a fully qualified filename if it finds one, otherwise it returns NULL. Example: /* Find COUNTRY.SYS */ SchPath = 'C:\OS2\SYSTEM;D:\OS2\SYSTEM;E:\OS2\SYSTEM' SAY RxSearchPath(SchPath,'COUNTRY.SYS') Output: D:\OS2\SYSTEM\COUNTRY.SYS /* if found in D:\OS2\SYSTEM */ ═══ 5.1.8. RxVolumeLabel ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXVOLUMELABEL(drive)─── Returns the volume label for disc drive drive. If no label exists, it returns 'NO LABEL'. Returns 'Error Querying drive label' for an invalid drive letter. You may append an optional colon to the letter, but only the drive letter itself is required. Example: SAY 'Volume Label of drive C is' RxVolumeLabel('C') Output: Volume Label of drive C is MY DRIVE C /* perhaps */ ═══ 5.1.9. RxWrite ═══ ═══ 5.1.10. RxFileExists ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXFILEEXISTS(file)─── Returns '1' if the file specified exists, '0' otherwise. RXFILEEXISTS will raise the REXX error condition INCORRECT CALL TO ROUTINE if a filename is not passed. Example: If RxFileExists('C:\CONFIG.SYS') Then Say 'I found your CONFIG.SYS!' Output: I found your CONFIG.SYS /* perhaps */ ═══ 5.1.11. RxSetFileHandles ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETFILEHANDLES(fileHandles)─── Returns an empty string ('') if the number of fileHandles available has been raised to the new value. The function can also return "Not enough memory", or "Invalid parameter" (when trying to set the file handles to a value less than it currently is). RXSETFILEHANDLES will raise the REXX error condition INCORRECT CALL TO ROUTINE if fileHandles is not passed, or is not greater than 0. Example: If RxSetFileHandles(100) Then Say '100 file handles are now available' Output: 100 file handles are now available /* perhaps */ ═══ 5.1.12. RxAddFileHandles ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXADDFILEHANDLES(fileHandlesToAdd)─── RxAddFileHandles returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │A number │Current number of file handles available│ └─────────────────────────┴────────────────────────────────────────┘ RXADDFILEHANDLES will raise the REXX error condition INCORRECT CALL TO ROUTINE if fileHandles is not passed. Example: rc = RxAddFileHandles(100) Say '100 more file handles are now available' Say 'There are now 'rc' file handles available' Output: 100 more file handles are now available There are now 121 file handles available ═══ 5.2. REXX Environment ═══ These APIs deal with accessing information to, from, or about 1 or more REXX Sessions. All of these functions are available only with RxExtras; there are no REXX commands which will achieve the same results. ═══ 5.2.1. RxExtra ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXEXTRA(─┬─'LOAD'─┬─)─── └─'DROP'─┘ Loads or Drops all functions in this package. Returns the version number of RxExtras after loading or dropping. Example: rcy = RxFuncAdd('RxExtra', 'RxExtras', 'RxExtra') Say 'Using version 'RxExtra("Load")' of RxExtras' Output: Using version 1.7 of RxExtras /* perhaps */ ═══ 5.2.2. RxGetGlobal ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXGETGLOBAL(──varname──)─── Returns the value for varname, where varname was previously defined via RXSETGLOBAL. If varname was not defined via RXSETGLOBAL, RXGETGLOBAL returns NULL. Example: Call RxSetGlobal 'MyVar','Hello World!' Say RxGetGlobal('MyVar') Output: Hello World! ═══ 5.2.3. RxSetGlobal ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETGLOBAL(──varname─,─varvalue──)─── Sets a global variable value for use across all REXX sessions. A variable thus set can be retrieved by any other REXX session via RXGETGLOBAL. You can set a global stem from a local stem by passing the global stem name (which must have a trailing period) for varname and passing the local stem name (which also must have a trailing period) for varvalue. Returns varvalue if successful. Example: SomeVar = 'MyVar' Call RxSetGlobal SomeVar,'Hello World!' Say RxGetGlobal('MyVar') Output: Hello World! ═══ 5.2.4. RxVarDump ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXVARDUMP(──'stemname.'──)─── Copies all local variables to stemname for debugging. The trailing period is required; results are unpredictable without it. RXVARDUMP always returns NULL. The count of variables retrieved is placed in stemname.0. Each unique variable is placed in a pair of variables, stemname.n.name and stemname.n.value and may be displayed in a loop or by other means. Example: XYZ = '123' MyVar = 'Quick Brown Fox' Call RxVarDump 'varlist.' Do Count = 1 to varlist.0 Say varlist.Count.name 'has the value "'varlist.Count.value'"' End Output: XYZ has the value "123" MYVAR has the value "Quick Brown Fox" ═══ 5.3. REXX Stems ═══ These APIs deal with accessing information to, from, or about REXX Stem variables. Some of them require PM REXX-based programs in order to function. ═══ 5.3.1. RxListBoxFromStem ═══ ═══ 5.3.2. RxListBoxToStem ═══ ═══ 5.3.3. RxQuerySwitchList ═══ ═══ 5.3.4. RxRead ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXREAD(──'stemname.'─,─┬────────┬─┬────────────┬──filename──)─── └─drive:─┘ └─\─┬───────┬┘ └─path\─┘ Reads filename into the stem variable stemname.. The trailing period to stemname. is required; results are unpredictable if it is not supplied. RXREAD assumes that the contents of filename are ASCII text, with each line terminated by a CR/LF. RXREAD always returns NULL if successful, and the count of lines retrieved is placed in stemname.0. Each unique line of text is place in stemname.n and may be displayed in a loop or by other means. If filename cannot be read, RXREAD raises an 'Incorrect call to routine' condition. Example: Call RxRead 'textlines.','C:\Config.Sys' Do Count = 1 to textlines.0 Say textlines.Count End Output: PROTSHELL=C:\OS2\PMSHELL.EXE /* perhaps */ SET USER_INI=C:\OS2\OS2.INI /* perhaps */ . . . ═══ 5.3.5. RxSetSpinButtonRangeFromStem ═══ ═══ 5.3.6. RxSort ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSORT(──'stemname.'──┬─[─,─'Ascending'─]─┬──[,──start──,──end──])─── └─[,─'Descending'─]─┘ Sorts a stemmed variable stemname. in either Ascending or Descending ASCII sequence. Only the A or D of the sort order is required. Ascending is the default if omitted. start and end default to the start and of the string if either is omitted. The number of items to sort must be placed in stemname.0. All values to sort must be in stemname.1 through stemname.n, where n is the number placed in stemname.0. RXSORT always returns NULL if invoked properly. Example: Stem.0 = 3 Stem.1 = 'Now is the time...' Stem.2 = 'A stitch in time...' Stem.3 = 'Somewhere in time...' Call RxSort 'Stem.','A', 1, 3 Do Count = 1 to Stem.0 Say Stem.Count End Say '-----------------' Call RxSort 'Stem.','D', 1, "" Do Count = 1 to Stem.0 Say Stem.Count End Output: A stitch in time... Now is the time... Somewhere in time... ----------------- Somewhere in time... Now is the time... A stitch in time... ═══ 5.3.7. RxStemCopy ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSTEMCOPY(──'sourcestem.'──,──'targetstem.'──)─── Copies the entire contents of sourcestem. to targetstem.. The trailing period to sourcestem. and targetstem. are required; results are unpredictable if they are not supplied. RXSTEMCOPY always returns NULL. Example: Source.ABC = 'ABCDEFG' Source.123 = '123456789' Call RxStemCopy 'Source.','Target.' Say Target.ABC Say Target.123 Output: ABCDEFG 123456789 ═══ 5.3.8. RxVarDump ═══ ═══ 5.3.9. RxWrite ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXWRITE(──'stemname.'─,─┬────────┬─┬────────────┬──filename──)─── └─drive:─┘ └─\─┬───────┬┘ └─path\─┘ Writes filename from the stem variable stemname.. The trailing period to stemname. is required; results are unpredictable if it is not supplied. RXWRITE requires that the number of lines to write are designated in stemname.0. It also requires that the lines of text are placed in stemname. such that entries are numeric in nature, starting at 1 and continuing up to the number defined in stemname..0. stemname. variables that are not numeric or are not within the range 1 to stemname.0 will not be written to filename. RXWRITE writes the text lines in ascending numerical order. RXWRITE always overlays the contents of a previously-existing file, otherwise it creates the file as required. RXWRITE always returns NULL if successful. If filename cannot be written, it raises an 'Incorrect call to routine' condition. Example: MyStem.0 = 4 MyStem.4 = 'We''re as happy as can be.' MyStem.2 = 'Hi There!' MyStem.3 = 'Ho There!' MyStem.1 = 'Hey There!' Call RxWrite 'MyStem.','C:\Temp.Out' Contents of C:\Temp.Out: Hey There! Hi There! Ho There! We're as happy as can be. ═══ 5.3.10. RxQueueList ═══ ═══ 5.3.11. RxQueueWriteStem ═══ ═══ 5.4. OS/2 Environment ═══ These APIs deal with accessing information about or changing characterstics of your OS/2 machine. ═══ 5.4.1. RxChangeThreadPriority ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXCHANGETHREADPRIORITY(──threadid───┬──────────────┬─)─── ├─,delta───────┤ ├─,'MINIMUM'───┤ ├─,'MAXIMUM'───┤ ├─,''──────────┤ ├─,────────────┤ Changes the priority of threadid by the delta value specified. If the value is left out, NULL or invalid, it is assumed to be the maximum. Note: For OS/2 REXX running in an OS/2 Window, use thread id 0 to set the priority of your program. RXCHANGETHREADPRIORITY returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │"Priority changed" │Priority was successfully changed │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid delta" │The second parameter was not in the │ │ │range -31 to +31, blank, "maximum" or │ │ │"minimum" │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid Thread id" │The first parameter did not specify a │ │ │valid thread id. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Unknown return code n" │DosSetPriority returned an undocumented │ │ │return code of n │ └─────────────────────────┴────────────────────────────────────────┘ Example: rc = RxChangeThreadPriority(threadId, 5) Results: rc should contain the value "Priority changed" ═══ 5.4.2. RxGetEXEName ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXGETEXENAME(──)─── Returns the name of the executable currently running your REXX Code. Example: Say "The current running program is "RxGetEXEName() Results: The currnet running program is CMD.EXE /* possibly */ ═══ 5.4.3. RxKillThread ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXKILLTHREAD(──threadid──)─── Kills thread threadid. RXKILLTHREAD returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │"Killed" │Thread was successfully killed │ ├─────────────────────────┼────────────────────────────────────────┤ │"Thread busy" │The thread to be killed was executing 16│ │ │bit code, or was created by 16 bit code.│ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid Thread id" │The first parameter did not specify a │ │ │valid thread id. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Unknown return code n" │DosKillThread returned an undocumented │ │ │return code of n │ └─────────────────────────┴────────────────────────────────────────┘ Example: If RxKillThread(5) = "Killed" Then Say "Printing ceased" Results: Thread number 5 is stopped permanently and rc should have the value "Killed" Note: RxKillThread returns to the caller without waiting for the ending thread to complete its termination processing. Note: You cannot use this function to end the current thread. If you use RxKillThread to end thread 1, the entire process ends. ═══ 5.4.4. RxQuerySwitchList ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUERYSWITCHLIST(──'stemname.'──)─── Retrieves a list of executing sessions into the stemmed variable stemname.. The count of executing sessions, plus 1, is placed in stemname.0, and the title of each session is placed in stemname.2 through stemname.n, where n is the value found in stemname.0. stemname.1 will contain 'Switch to'. Note that RXQUERYSWITCHLIST will list "hidden" sessions. RXQUERYSWITCHLIST always returns NULL. stemname.n.HWND holds the nth entry's window handle. stemname.n.PID holds the nth entry's process id. Example: Call RxQuerySwitchList 'temp.' Do Count = 2 to temp.0 Say temp.Count End Output: 4OS2 Window /* perhaps */ Tritus SPF /* perhaps */ System Clock /* perhaps */ Pulse /* perhaps */ Desktop /* perhaps */ ═══ 5.4.5. RxResumeThread ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXRESUMETHREAD(──threadid──)─── Allows thread threadid to resume execution after being suspended with RXSUSPENDTHREAD. RXRESUMETHREAD returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │"Resumed" │Thread was successfully resumed │ ├─────────────────────────┼────────────────────────────────────────┤ │"Thread not previously │The thread to be resumed had not been │ │suspended" │previously suspended │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid Thread id" │The first parameter did not specify a │ │ │valid thread id. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Unknown return code n" │DosResumeThread returned an undocumented│ │ │return code of n │ └─────────────────────────┴────────────────────────────────────────┘ Example: If RxResumeThread(5) = 'Resumed' Then Say 'Suspended Printing Continues...' Results: Thread number 6 continues processing /* hopefully */ ═══ 5.4.6. RxSetThreadClass ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETTHREADCLASS(──threadid ──,─┬─'REGULAR'──────────┬──)─── ├─'IDLE'─────────────┤ ├─'TIMECRITICAL'─────┤ └─'FOREGROUNDSERVER'─┘ Sets the class type of thread threadid to one of REGULAR, IDLE, TIMECRITICAL, or FOREGROUNDSERVER. Only the R, I, T or F of the class type is required. Note: For OS/2 REXX running in an OS/2 Window, use thread id 0 to set the priority class of your program. RXSETTHREADCLASS returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │"Class set" │The class of the thread was successfully│ │ │set │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid class" │The class pthread to be killed was │ │ │executing 16 bit code, or was created by│ │ │16 bit code. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid Thread id" │The first parameter did not specify a │ │ │valid thread id. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Unknown return code n" │DosKillThread returned an undocumented │ │ │return code of n │ └─────────────────────────┴────────────────────────────────────────┘ Example: If RxSetThreadClass(id, 'F') = 'Class set' Then Say 'Printing sped up to foreground priority' Results: The thread should perform better than previously ═══ 5.4.7. RxSuspendThread ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSUSPENDTHREAD(──threadid──)─── Causes thread threadid to halt execution until it is killed with RXKILLTHREAD, restarted with RXRESUMETHREAD, or the parent session is closed. RXSUSPENDTHREAD returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │"Suspended" │The class of the thread was successfully│ │ │set │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid Thread id" │The first parameter did not specify a │ │ │valid thread id. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Unknown return code n" │DosSuspendThread returned an │ │ │undocumented return code of n │ └─────────────────────────┴────────────────────────────────────────┘ Example: Call RxSuspendThread id If (result = 'Suspended') Then Say 'Thread 'id' is temporarily suspended' Results: The thread number contained in the variable id is suspended. ═══ 5.4.8. RxSwitchTo ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSWITCHTO(──'session'──)─── Switches the forground session to the the session named by session. RXSWITCHTO will attempt to locate a session, by name, that matches in any part of its name to the contiguous characters defined by session For example, if session contains 'stem C', RXSWITCHTO will switch to the System Clock session, if it is active. If you desire to specifiy a complete name, use RXQUERYSWITCHLIST to obtain the full names of all executing sessions. RXSWITCHTO returns 'Switch Entry not found' if it cannot find a session name to match session. Example: Call RxSwitchTo '2.0' /* try "OS/2 2.0 Desktop" */ If Result \= '' Then /* probably 2.1 */ Call RxSwitchTo 'Desktop' Results: The system switches to your OS/2 desktop, making it the active forground session. Your REXX program continues to execute in the background. ═══ 5.4.9. RxThread ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│.......│ └─────────┴───────────┴───────┘ ───RXTHREAD(──'ProcName'───┬───────────┬──)─── │┌─────────┐│ │ ││ └┴, arg────┴┘ Causes the SubProc called ProcName to start execution in its own separate thread. As many arguments as REXX allows (up to 16 currently) can be passed to the SubProc by specifying them after the SubProc name. The new thread runs asynchronously until it is suspended (RXSUSPENDTHREAD), is killed (RXKILLTHREAD), terminates of its own accord, or the parent session is closed. RXTHREAD returns the thread id if successful, otherwise it returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │"Out of memory" │There was not enough memory to start the│ │ │thread │ ├─────────────────────────┼────────────────────────────────────────┤ │"Interrupt" │The system was interrupted during thread│ │ │creation and the thread was aborted │ ├─────────────────────────┼────────────────────────────────────────┤ │"Protection violation" │The system encountered a protection │ │ │violation (accessing inaccesible memory │ │ │usually) while starting the thread. The │ │ │thread is aborted │ ├─────────────────────────┼────────────────────────────────────────┤ │"Too many threads" │The system could not create any more │ │ │threads. Check your THREADS= line in the│ │ │CONFIG.SYS. It may be too low. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Unknown return code n" │DosCreateThread returned an undocumented│ │ │return code n │ └─────────────────────────┴────────────────────────────────────────┘ Note: The value returned is the threadid required for use with other RxExtras thread functions. Note: SubProcs started using RxThread CANNOT call other SubProcs or use global variables defined in VisPro/REXX. Note: Global Variables such as those created by RxSetGlobal can be used. Note: The author is working on removing these restrictions. Example: tid = RxThread('SEARCH', window, listboxid, text) Results: tid will hold the thread id that was returned when the SubProc SEARCH was executed in parallel. ═══ 5.4.10. RxNap ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXNAP(──time──)─── Puts a REXX program to sleep for a certain amount of time. The SysSleep function that comes with OS/2 will only put your program to sleep for whole seconds. If the time specified (in milliseconds) is invalid, or is not passed to the function, an INCORRECT CALL TO ROUTINE condition is raised from within REXX. Example: Call RxNap 50 /* sleep for 1/20 of a second */ Results: The REXX program will stop execution for 1/20 of a second ═══ 5.4.11. RxKillProcess ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXKILLPROCESS(──procid──)─── Kills process procid. RXKILLPROCESS returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │"Killed" │Process was successfully killed │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid data" │An internal error occurred - contact the│ │ │RxExtras author. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid process id" │The parameter did not specify a valid │ │ │process id. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Zombie process" │OS/2 considers the process unkillable. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Not a descendant │When killing a tree of processes (not │ │process" │yet implemented), the process specified │ │ │was not a descendant of the calling │ │ │process. │ └─────────────────────────┴────────────────────────────────────────┘ Example: If RxKillProcess(5) = "Killed" Then Say "Printing ceased" Results: Process number 5 is stopped permanently and rc should have the value "Killed" Note: See also RxKillThread. ═══ 5.4.12. RxMatchWildCard ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXMATCHWILDCARD(──source──, ──wildCard──)─── RxMatchWildCard is used to search for and edit names of files and subdirectories. Typically, it is used in conjunction with functions which do not permit the use of global file-name characters, to perform repetitive operations on files. An example of an editing operation is:- source = "foo.bar" wildCard = "*.baz" Call RxMatchWildCard source, wildCard /* result = "FOO.BAZ" */ In the editing process, the string is changed to uppercase. Global file-name characters (?, *, .) have two uses:- searching and editing. If they are specified in source, they are interpreted as search characters; in wildCard, they are interpreted as editing characters. This difference can be illustrated with an example using the COPY utility. The user types the following:- copy *.old *.new In the source, "*" acts as a search character and determines which files to return to the user. In the target, "*" functions as an editing character by constructing new names for the matched files. When used as search characters in source, global file-name characters simply match files and behave like any other search characters. They have the following meanings:- . The period (.) has no special meaning itself, but "?" gives it one. * The asterisk will form a match with any character, including a blank, or with the absence of a character. The matching operation does not cross the null character or the backslash (\), which means that only the file name is matched, not an entire path. ? The question mark matches 1 character, unless what it would match is a "." or the terminating null characters, in which case it matches 0 characters. It also does not cross "\". Any character other than * and ? matches itself, including ".". Searching is not case-sensitive. If a file name does not have a period (.), an implicit one is automatically appended to the end during searching operations. For example, searching for "foo." would return "foo". When used in wildCard, global file-name characters have the following meanings:- . The period (.) in the target synchronizes pointers. It causes the source pointer to match a corresponding pointer to the period in the target. Counting starts from the left of the pointers. ? The question mark copies one character, unless what it would copy is a period (.), in which case it copies no characters. It also copies no characters when the end of the source string is reached. * The asterisk copies characters from the source to the target until it finds a source character that matches the character following it in the target. Editing is case-insensitive and case-preserving. If conflicts arise between the case of the source and that of the editing string, the case of the editing string is used, for example:- source string: "file.txt" editing string: "*E.TMP" result string: "filE.TMP" copy file.txt *E.tmp -> filE.tmp RXMATCHWILDCARD returns :- ┌─────────────────────────┬────────────────────────────────────────┐ │Return value │Reason │ ├─────────────────────────┼────────────────────────────────────────┤ │text │The result of editing the source and │ │ │wildcard │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid parameter" │An internal error occurred - contact the│ │ │RxExtras author. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Invalid name" │Either the source or wildCard parameter │ │ │did not specify a valid string for │ │ │editing. │ ├─────────────────────────┼────────────────────────────────────────┤ │"Unknown retured code x │An unknown return code was encountered. │ │ │Contact the author of RxExtras with the │ │ │return code info. │ └─────────────────────────┴────────────────────────────────────────┘ Example: value = RxMatchWildCard('CONFIG.SYS', '*.BAK') Say "Creating a backup of your CONFIG.SYS in "value Results: Creating a backup of your CONFIG.SYS in CONFIG.BAK ═══ RxChangeThreadPriority (threadID, delta) ═══ Changes the priority of the thread id specified by the delta amount specified. The delta value must be in the range -31 to +31. ═══ RxChangeThreadPriority (threadID, 'Minimum') ═══ Lowers the priority of the thread id specified by the most possible (-31). Only the first two characters of the second parameter are significant. ═══ RxChangeThreadPriority (threadID, 'Maximum') ═══ Raises the priority of the thread id specified by the most possible (+31). Only the first two characters of the second parameter are significant. ═══ RxChangeThreadPriority (threadID, '') ═══ Raises the priority of the thread id specified by the most possible (+31). ═══ RxSetThreadClass (threadID, 'REGULAR') ═══ Sets the class of the specified thread id to REGULAR. This is the class of applications running in the background. The application with focus runs at FOREGROUNDSERVER ═══ RxSetThreadClass (threadID, 'IDLE') ═══ Sets the class of the specified thread id to IDLE. This is one step less important than a normal application. ═══ RxSetThreadClass (threadID, 'FOREGROUNDSERVER') ═══ Sets the class of the specified thread id to FOREGROUNDSERVER. This is the class of the applications that currently has focus, or a server thread needing higher than normal CPU. ═══ RxSetThreadClass (threadID, 'TIMECRITICAL') ═══ Sets the class of the specified thread id to TIMECRITICAL. This should be used very sparingly as it can make the foreground applcation unresponsive, since a TIMECRITICAL thread gets more of the CPU than any FOREGROUNDSERVER thread. ═══ 5.5. ListBox Objects ═══ These APIs deal with PM ListBox Objects. They require a PM REXX-based program in order to function. ═══ 5.5.1. RxAddItemAtIndex ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXADDITEMATINDEX(──winid──,──[lbid]──,──row──,──value──)─── Inserts the entry value at line row into ListBox lbid of Window winid. If either winid or lbid are invalid, the rexx error condition INCORRECT CALL TO ROUTINE is raised. RXADDITEMATINDEX returns the index that the item was inserted at if successful, otherwise it returns :- ┌──────────┬────────────────────────────────────────┐ │Return │Reason │ │value │ │ ├──────────┼────────────────────────────────────────┤ │-1 │There was not enough memory to insert │ │ │the item into the list box │ ├──────────┼────────────────────────────────────────┤ │-2 │An error occurred inserting the item │ │ │into the listbox │ └──────────┴────────────────────────────────────────┘ Example: Call RxAddtItemAtIndex window, 1000, 4, 'This is the fourth line' Results: The ListBox with ID=1000 in window window receives a new row 4, the contents of which are 'This is the fourth line'. Rows 5 and higher are shifted down 1 row. The REXX special variable result contains 4. ═══ 5.5.2. RxGetItemFromListBox ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXGETITEMFROMLISTBOX(──winid──,──lbid──)─── Retrieves the first selected item from ListBox lbid of Window winid. If either winid or lbid are invalid, the REXX error condition INCORRECT CALL TO ROUTINE is raised. If no items are selected, RXGETITEMFROMLISTBOX returns an empty string (""). If winid and/or lbid are invalid, RXGETITEMFROMLISTBOX raises an INCORRECT CALL TO ROUTINE error from within REXX. Otherwise, RXGETITEMFROMLISTBOX returns the selected item. Note: The VisPro/Rexx API VpGetItemValue will only return up to 256 characters for the retrieved item. RxGetItemFromListBox will exactly what is in the listbox. Example: row = RxGetItemFromListBox(window, 1000) Results: The first selected item in ListBox 1000 of window window is retrieved and placed in the variable row. ═══ 5.5.3. RxGetItemFromListBoxAtIndex ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXGETITEMFROMLISTBOXATINDEX(──window──,──lbid──,──row──)─── Retrieves the line row from ListBox lbid of Window window. If no item exists at line row in window and/or lbid are invalid, RXGETITEMFROMLISTBOXATINDEX raises an INCORRECT CALL TO ROUTINE error from within REXX. Otherwise, RXGETITEMFROMLISTBOXATINDEX returns the item of choice. Note: The VisPro/Rexx API VpGetItemValueAtIndex will only return up to 256 characters for the retrieved item. RxGetItemFromListBoxAtIndex will return whatever is in the listbox, with no limitations. Example: row = RxGetItemFromListBoxAtIndex(window, 1000, 4) Results: If it exists, the item at line 4 in ListBox 1000 of window window is retrieved and placed in the variable row. ═══ 5.5.4. RxGetListBoxCount ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXGETLISTBOXCOUNT(──winid──,──lbid──)─── Retrieves the number of rows available in ListBox lbid of Window winid. If winid and/or lbid are invalid, RXGETLISTBOXCOUNT raises the INCORRECT CALL TO ROUTINE error condition from within REXX. Otherwise, RXGETLISTBOXCOUNT returns the number of available rows. Example: items = RxGetListBoxCount(window, 1000) Results: The number of rows in ListBox 1000 of window window are placed in the variable items. ═══ 5.5.5. RxListBoxFromFile ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXLISTBOXFROMFILE(──winid──,──┬──────┬─,──filename──)─── └─lbid─┘ Places the contents of file filename into ListBox lbid of Window winid. If lbid is omitted, winid is assumed to be the handle of a list box. If winid and/or filename are invalid/inaccessible, RXLISTBOXFROMFILE raises an INCORRECT CALL TO ROUTINE condition from within REXX. Otherwise, RXLISTBOXFROMFILE returns a null string. Note: For VisPro/Rexx, winid is passed to all events. Note: This API appends to the end of any existing contents already in ListBox lbid. VisPro/REXX Example: Call RxListBoxFromFile window, 1000, 'C:\Config.Sys' VX-REXX Example: window = VRGet("LB_1", "HWnd") Call RxListBoxFromFile window,, 'C:\Config.Sys' Results: The contents of C:\Config.Sys are placed into ListBox 1000 of window window (or listbox "LB_1" for VX-REXX). ═══ 5.5.6. RxListBoxFromStem ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXLISTBOXFROMSTEM(──winid──,──lbid──,──stemname.──)─── Places the contents of stem stemname into ListBox lbid of Window winid. The trailing period to stemname. is required; results are unpredictable if not supplied. stemname.0 must contain the count of items to be placed into ListBox lbid. All other occurrences for stemname must be numeric, from 1 to n, where n is the number contained in stemname.0. If winid and/or lbid are invalid, RXLISTBOXFROMSTEM raises an INCORRECT CALL TO ROUTINE from within REXX. Otherwise, RXLISTBOXFROMSTEM returns an empty string (""). Note: This API appends to the end of any existing contents already in ListBox lbid. Example: MyStem.0 = 2 MyStem.1 = 'This will be the 1st line added' MyStem.2 = 'This will be the 2nd line added' Call RxListBoxFromStem window, 1000, 'MyStem.' Results: The contents of ListBox 1000 of window window will have 2 new rows. The rows will be: This will be the 1st line added This will be the 2nd line added ═══ 5.5.7. RxListBoxItemHandle ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXLISTBOXITEMHANDLE(──window──,─[──listboxid──]─,──index──[,──value──])─── This call either sets or queries some text associated with a ListBox item. It does not change the text of the item or affect it in any other way. If winid and/or index are invalid, RXLISTBOXFROMSTEM raises an INCORRECT CALL TO ROUTINE from within REXX. If the value parameter is omittted, RXLISTBOXITEMHANDLE returns the text associated with that list box item (it's handle). If the value parameter is specified, RXLISTBOXITEMHANDLE sets the text associated with that list box item to the value. If the listboxid parameter is omitted, window is assumed to be the window handle of a listbox. VisPro/REXX Example: Call RxListBoxItemHandle window, 1000, 1, 'Line 1 must not be deleted' VX-REXX Example: window = VRGet("LB_1", "HWnd") Call RxListBoxItemHandle window,, 1, 'Line 1 must not be deleted' Results: The first item (index 1) with have the text 'Line 1 must not be deleted' associated with it. This text can be queried using RxListBoxItemHandle by omitting the value parameter. ═══ 5.5.8. RxListBoxToFile ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXLISTBOXTOFILE(──winid──,─[──lbid──]─,──filename──)─── Places the contents ListBox lbid of Window winid into file filename. If winid and/or filename are invalid/inaccessible, RXLISTBOXTOFILE raises the REXX INCORRECT CALL TO ROUTINE error condition. Otherwise, RXLISTBOXTOFILE returns an empty string (""). If lbid is omitted, winid is assumed to be the window handle of a listbox. Note: This API erases all contents of file filename before writing to it. VisPro/REXX Example: Call RxListBoxToFile window, 1000, 'C:\MyData.Dat' VX-REXX Example: window = VRGet("LB_1", "HWnd") Call RxListBoxToFile window,, 'C:\MyData.Dat' Results: The contents of ListBox 1000 of window window (or listbox "LB_1" for VX-REXX) are written to file C:\MyData.Dat. ═══ 5.5.9. RxListBoxToStem ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXLISTBOXTOSTEM(──winid──,──lbid──,──stemname.──)─── Places the contents of ListBox lbid of Window winid into stem stemname. The trailing period to stemname. is required; results are unpredictable if not supplied. stemname.0 will contain the count of items to placed into it from ListBox lbid. All other occurrences for stemname will be numeric, from 1 to n, where n is the number contained in stemname.0. If winid and/or lbid are invalid, RXLISTBOXTOSTEM raises the REXX error condition INCORRECT CALL TO ROUTINE. Otherwise, RXLISTBOXTOSTEM returns an empty string (""). Note: This API destroyes any existing contents already in stem stemname. Example: Call RxListBoxToStem window, 1000, 'MyStem.' Results: The contents of ListBox 1000 of window window will be copied to stem MyStem. Assuming there are 2 rows in ListBox 1000, MyStem.0 will contain 2, and occurrences will exist for MyStem.1 and MyStem.2. ═══ 5.5.10. RxScrollListBox ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSCROLLISTBOX(──winid──,─[──lbid──]─,──numLinesToScroll.──)─── Scrolls the ListBox lbid of Window winid by numLinesToScroll lines. A negative value should be used to scroll up, a positive value to scroll the listbox down. If winid and/or lbid are invalid, RXSCROLLLISTBOX raises the REXX error condition INCORRECT CALL TO ROUTINE. If lbid is omitted, winid is assumed to be the window handle of a listbox. if numLinesToScroll is not numeric, the listbox is simply not scrolled. Otherwise, RXSCROLLLISTBOX returns an empty string (""). VisPro/REXX Example: Call RxScrollListBox window, 1000, -3 VX-REXX Example: window = VRGet("LB_1", "HWnd") Call RxScrollListBox window,, -3 Results: The contents of ListBox 1000 (or the listbox called "LB_1" for VX-REXX) of window window will be scrolled up 3 lines ═══ 5.5.11. RxSearchItem ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ Searches a listbox for text. Doesn't have to be an entire line, it can be text contained within one line of a listbox. RxSearchItem returns the line in the listbox that holds the text. ───RXSEARCHITEM(──winid──,──lbid──,─┬─''───┬─,──row──,─┬─'F'─┬──)─── └─mask─┘ └─'B'─┘ Searches ListBox lbid of Window winid, starting at line row, for a line containing the characters mask. The search will procede forward or backward, depending on the use of 'F' or 'B', respectively. If winid and/or lbid are invalid, RXSEARCHITEM raises the REXX error condition INCORRECT CALL TO ROUTINE. Otherwise, RXSEARCHITEM returns the index number of the first matching line, or 0 if no lines were found to match mask. 0 is used to indicate no match. Note: If NULL (i.e., '') is used for mask, the first item tested will match. RXSEARCHITEM can therefore be used to retrieve the index of the last item in ListBox lbid. Example: JohnIsAt = RxSearchItem(window, 1000, 'John Smith', 1, 'F') Results: The contents of ListBox 1000 of window window will be searched, starting at row 1 and proceding in a forward direction, looking for any row that contains the characters 'John Smith'. If found, variable JohnIsAt will contain the index (row number) of the matching entry. Otherwise, JohnIsAt will contain 0. ═══ 5.6. PushButton Objects ═══ These APIs deal with PM PushButton Objects. They require a PM REXX-based program in order to function. ═══ 5.6.1. RxMorphButtonToIcon ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXMORPHBUTTONTOICON(──winid──,─┬──────┬─,──┬─VpLoadPictureHandle──┬──)─── └─pbid─┘ └─DLLname──,──resource─┘ Converts a standard PushButton object pbid of window winid into a "Toolbox" button. If any arguments are invalid or inaccessible, RXMORPHBUTTONTOICON raises the REXX error condition INCORRECT CALL TO ROUTINE. Otherwise, RXMORPHBUTTONTOICON returns an empty string (""). If pbid is ommitted, winid is assumed to be the window handle of a pushbutton. Note: The use of VpLoadPictureHandle requires VisPro/Rexx. You must call VpLoadPicture and obtain the handle. Note: The use of DLLName, resource can be used by any PM REXX-based program, and retrieves the requested icon. If DLLname is in your LIBPATH, do not specify an extension of '.DLL'. Note: In order to make the window appear to start-up with your required icons, you should call RXMORPHBUTTONTOICON immediately at entry to your program, when the window is being opened. Otherwise, the user will see the buttons change appearance. VisPro/REXX Example: value = VpLoadPicture('FILE','C:\TEMP\OS2CMD.ICO') Call RxMorphButtonToIcon window, 2000, value Note: VX-REXX can only use the DLLname and resource form of this API. VX-REXX Example: window = VRGet("PB_1", "HWnd") Call RxMorphButtonToIcon window,, 'PMWP', 13 Results: The PushButton with ID=2000 in window 'window' (or specified by window for VX-REXX) is changed to an OS/2 Command-Prompt icon (stored previously in C:\TEMP\OS2CMD.ICO, or as ICON number 13 in PMWP.DLL) ═══ 5.7. SpinButton Objects ═══ These APIs deal with PM SpinButton Objects. They require a PM REXX-based program in order to function. ═══ 5.7.1. RxSetSpinButtonCharRange ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETSPINBUTTONCHARRANGE(──winid──,──[sbid]──,──low──,──high──)─── Sets the SpinButton sbid of Window winid to include the ASCII character range low through high. Only the first character of low and high are used. If winid is invalid, RXSETSPINBUTTONCHARRANGE raises the REXX error condition INCORRECT CALL TO ROUTINE. If sbid is omitted, winid should be the PM window handle (HWnd) of a spinbutton. Otherwise, RXSETSPINBUTTONCHARRANGE returns an empty string (""). VisPro/REXX Example: Call RxSetSpinButtonCharRange Hwindow, 4000, 'a', 'z' VX-REXX Example: Call RxSetSpinButtonCharRange VRGet("SPIN_1", "Hwnd),, 'a', 'z' Results: The SpinButton (with ID=4000 for VisPro/REXX and called SPIN_1 in VX-REXX) now contains the selection character set 'a' through 'z', inclusive. ═══ 5.7.2. RxSetSpinButtonRangeFromStem ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETSPINBUTTONRANGEFROMSTEM(──winid──,──[sbid]──,──stemname.──)─── Sets the SpinButton sbid of Window winid to include the values found in stem stemname. The trailing period to stemname. is required; results are unpredictable if not supplied. stemname.0 must contain the number of values to assign to SpinButton sbid. All other occurences of stemname should contain the values desired for sbid, and be in the range 1 to n, where n is the value contained in stemname.0. If winid is invalid, RXSETSPINBUTTONRANGEFROMSTEM raises the REXX error condition INCORRECT CALL TO ROUTINE. If sbid is omitted, winid should be the PM window handle (HWnd) of a spinbutton. Otherwise, RXSETSPINBUTTONRANGEFROMSTEM returns an empty string (""). VisPro/REXX Example: days.0 = 7; days.1 = 'Sun'; days.2 = 'Mon'; days.3 = 'Tue'; days.4 = 'Wed'; days.5 = 'Thu'; days.6 = 'Fri'; days.7 = 'Sat'; Call RxSetSpinButtonRangeFromStem Hwindow, 4000, 'days.' VX-REXX Example: days.0 = 7; days.1 = 'Sun'; days.2 = 'Mon'; days.3 = 'Tue'; days.4 = 'Wed'; days.5 = 'Thu'; days.6 = 'Fri'; days.7 = 'Sat'; Call RxSetSpinButtonRangeFromStem VRGet("SPIN_1", "HWnd"),, 'days.' Results: The SpinButton (with ID=4000 in VisPro/REXX and called SPIN_1 in VX-REXX) now contains the selection character set 'Sun', 'Mon', 'Tue', 'Wed' etc. ═══ 5.7.3. RxSetSpinButtonRangeWithIncrement ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETSPINBUTTONRANGEWITHINCREMENT(──winid──,──[sbid]──,──low──,──high──,───── ───────────────────────────────────────increment───────────────────────────)── Sets the SpinButton sbid of Window winid to the numeric range of low to high, in incriments of incriment. If winid is invalid, RXSETSPINBUTTONRANGEWITHINCRIMENT raises the REXX error condition INCORRECT CALL TO ROUTINE. If sbid is omitted, winid should be the PM window handle (HWnd) of a spinbutton. Otherwise, RXSETSPINBUTTONRANGEWITHINCRIMENT returns an empty string (""). VisPro/REXX Example: Call RxSetSpinButtonRangeWithIncrment window, 4000, 0, 10000, 2000 VX-REXX Example Call RxSetSpinButtonRangeWithIncrement VRGet("SPIN_1", "HWnd"),,0,10000,2000 Results: The SpinButton (with ID=4000 or called SPIN_1) now contains the selection numeric set 0, 2000, 4000, 6000, 8000, and 10000. Note: The maximum number of discrete values that this function can store in a spin button is 4096. ═══ 5.8. Window Objects ═══ These APIs deal with OS/2 Windows and PM window types & hierarchies. They require a window handle, therefore, a PM REXX-based program in order to function. ═══ 5.8.1. RxMaximize ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXMAXIMIZE(──winid──)─── Causes window winid to become maximized. If winid is invalid, RXMAXIMIZE raises the REXX error condition INCORRECT CALL TO ROUTINE. If an error occurs, RXMAXIMIZE returns "Error occured trying to maximize", otherwise, RXMAXIMIZE returns an empty string (""). VisPro/REXX Example: Call RxMaximize window VX-REXX Example: HWnd = VRGet("MyWindow", "HWnd") Call RxMaximize HWnd Results: The window 'window' is maximized. ═══ 5.8.2. RxMinimize ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXMINIMIZE(──winid──)─── Causes window winid to become minimized. If winid is invalid, RXMINIMIZE raises the REXX error condition INCORRECT CALL TO ROUTINE. If RXMINIMIZE encounters an error, it returns "Error trying to minimize", otherwise, RXMINIMIZE returns an empty string (""). VisPro/REXX Example: Call RxMinimize window VX-REXX Example: HWnd = VRGet("MyWindow", "HWnd") Call RxMinimize HWnd Results: The window 'window' is minimized. ═══ 5.8.3. RxQueryClassName ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUERYCLASSNAME(──winid──)─── Returns the Class Name for window winid. If winid is invalid, RXQUERYCLASSNAME raises the REXX error condition INCORRECT CALL TO ROUTINE. If an error occurs, RXQUERYCLASSNAME returns "Error trying to query classs name", otherwise, RXQUERYCLASSNAME returns the PM Class Name for the window. VisPro/REXX Example: WinClass = RxQueryClassName(window) VX-REXX Example: HWnd = VRGet("MyWindow", "HWnd") WinClass = RxQueryClassName(HWnd) Results: The Class Name of window 'window' is placed in the variable WinClass. ═══ 5.8.4. RxQueryWindow ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUERYWINDOW(──winid──,─┬─'Owner'──────┬─)─── ├─'Parent'─────┤ ├─'Next'───────┤ ├─'Prev'───────┤ ├─'Top'────────┤ ├─'Bottom'─────┤ ├─'NextTop'────┤ ├─'PrevTop'────┤ └─'FrameOwner'─┘ Returns the window handle for the requested related window to winid. Double-click on each window relation above for further information. If winid is invalid, RXQUERYWINDOW raises the REXX error condition INCORRECT CALL TO ROUTINE. Otherwise, RXQUERYWINDOW returns the requested PM window handle, in decimal. VisPro/REXX Example: WinParent = RxQueryWindow(window, 'Parent') VX-REXX Example: HWnd = VRGet("MyWindow", "HWnd") WinParent = RxQueryWindow(HWnd, 'Parent') Results: The parent window handle, in decimal, for window 'window' is placed in the variable WinParent. ═══ 5.8.5. RxRestore ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXRESTORE(──winid──)─── Restores window winid to its normal state after being maximized or minimized. If winid is invalid, RXRESTORE raises the REXX error condition INCORRECT CALL TO ROUTINE. If an error occurs, RXRESTORE returns "Error trying to restore", otherwise, RXRESTORE restores the requested PM window, and returns an empty string (""). VisPro/REXX Example: Call RxRestore window VX-REXX Example: HWnd = VRGet("MyWindow", "HWnd") Call RxRestore HWnd Results: Restores the window 'window' from a minimised state. ═══ 5.8.6. RxSetIcon ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETICON(──winid──,──┬─VpLoadPictureHandle──┬──)─── └─DLLname──,──resource─┘ Sets the icon for a window. This icon is the one used when a window is minimized. If winid is invalid, RXSETICON raises the REXX error condition INCORRECT CALL TO ROUTINE. If an error occurs loading the icon from a DLL, RXSETICON returns "Error loading icon from DLL". If an error occurs setting the icon, RXSETICON returns "Error setting icon". Otherwise RXSETICON returns an empty string (""). Note: There are many icons held within the Work Place Shell DLL's. An ICONS.CMD file, which is part of the REXXUTIL information that IBM supplies on CIS or BBS's, can show you most of these. If you would like this file, please contact the author of RxExtras. VisPro/REXX Example: value = VpLoadPicture('FILE', 'C:\TEMP.ICO'); FrameWindow = RxQueryWindow(RxQueryWindow(window, 'parent'), 'parent') Call RxSetIcon FrameWindow, value Note: VX-REXX programs can only use the DLL and resource number form of this API. VX-REXX Example: HWnd = VRGet("MyWindow", "HWnd") FrameWindow = RxQueryWindow(HWnd, 'parent') Call RxSetIcon FrameWindow, 'PMWP', 13 Results: Loads an icon from C:\TEMP.ICO (or PMWP.DLL icon number 13). Calculates the Frame Window (the one that the user interacts with) from the window passed to a VisPro/REXX event (or VX-REXX object). Sets the minimized icon for the window passed. ═══ 5.8.7. RxWindowSetFocus ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXWINDOWSETFOCUS(──window──)─── Switches focus to window window. If window is an invalid string, RXWINDOWSETFOCUS raises the REXX error condition INCORRECT CALL TO ROUTINE. If an error occurs, RXWINDOWSETFOCUS returns "Error setting focus", otherwise, RXWINDOWSETFOCUS sets the focus to the window requested and returns an empty string (""). You can use this call to bring a VisPro/REXX form to the foreground when necessary. window can be the variable passed to as an argument to all VisPro/REXX events, or it could be the value returned from a VpOpenForm call. VisPro/REXX Example: Call RxWindowSetFocus window VX-REXX Example: HWnd = VRGet("MyWindow", "HWnd") Call RxWindowSetFocus HWnd Results: Switches focus to the window 'window'. ═══ 5.8.8. RxWindowSetOwner ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXWINDOWSETOWNER(──window──,──owningWindow──)─── Sets the owner of window to be owningWindow. This has the effect of making window always 'stay on top' of owningWindow. If window and/or owningWindow is an invalid string, RXWINDOWSETFOCUS raises the REXX error condition INCORRECT CALL TO ROUTINE. If an error occurs, RXWINDOWSETOWNER returns "Error setting owner", otherwise, RXWINDOWSETOWNER sets the owner of the first window to the second window passed and returns an empty string (""). You can use this call to make a window stay on top of another window, even when the other window is explicitly given focus by the user. VisPro/REXX Example: value = VpOpenForm(window, 257, 'topic of secondary form') Call RxWindowSetFocus window, value VX-REXX Example: window = VRGet("MyWindow", "HWnd") value = VRGet("MySecondWindow", "HWnd") Call RxWindowSetOwner window, value Results: Makes the window whose handle is in the variable 'value', stay on top of the window whose handle is in the variable 'window'.' ═══ 5.8.9. RxWindowQueryText ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXWINDOWQUERYTEXT(──window──[,──id──]──)─── Returns the text of the window identified by either the window alone, or by the window and an id This will give you the text of an entry field or MLE, or static text. If window is an invalid string, RXWINDOWQUERYTEXT raises the REXX error condition INCORRECT CALL TO ROUTINE. This function was written specifically to correct bugs with MLE's in VisPro/REXX V1.1. VisPro/REXX Example: value = RxWindowQueryText(window, 1001) /* id 1001 is an MLE */ VX-REXX Example: HWnd = VRGet("MLE_1", "HWnd") value = RxWindowQueryText(HWnd) Results: Places the text of the window into the variable value. ═══ RxQueryWindow (winid,'Owner') ═══ Requests the Owner window handle of winid. The Owner window is the one which window winid is dependent upon. Quite frequently, this is the same as 'Parent'. ═══ RxQueryWindow (winid,'Parent') ═══ Requests the Parent window handle of winid. The Parent window is the one that causes window winid to be initialized. ═══ RxQueryWindow (winid,'Next') ═══ Requests the Next window handle, in z-order, of winid. This is the next window at the same "level" as window winid. ═══ RxQueryWindow (winid,'Prev') ═══ Requests the Previous window handle, in z-order, of winid. This is the previous window at the same "level" as window winid. ═══ RxQueryWindow (winid,'Top') ═══ Requests the Topmost (first) "child" window handle of winid. This is the first window that window winid caused to be initialized. ═══ RxQueryWindow (winid,'Bottom') ═══ Requests the Bottommost (last) "child" window handle of winid. This is the last window that window winid caused to be initialized. ═══ RxQueryWindow (winid,'NextTop') ═══ Requests the next window, in z-order, of the owner window hierarchy for winid. See 'Owner'. ═══ RxQueryWindow (winid,'PrevTop') ═══ Requests the previous window, in enumeration order defined by NextTop, of the owner window hierarchy for winid. See 'Owner'. ═══ RxQueryWindow (winid,'FrameOwner') ═══ Requests the owner of winid, normalized so that it shares the same window as its Parent. ═══ 5.9. Free Form window Objects ═══ These APIs deal with VisPro/REXX Free Form Window Objects. They require a PM REXX-based program in order to function. ═══ 5.9.1. RxDrawBitmap ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXDRAWBITMAP(──winid──,─┬────┬─,──┬─VpLoadPictureHandle──┬──)─── └─pbid─┘ └─DLLname──,──resource─┘ Draws a bitmap in a free form window of id ffid in window winid. RXDRAWBITMAP will stretch the bitmap to take up the entire size of the free form window. If any arguments are invalid or inaccessible, RXDRAWBITMAP raises the REXX error condition INCORRECT CALL TO ROUTINE. If there is an error loading the bitmap from a DLL, RXDRAWBITMAP will return "Error loading bitmap from DLL". Otherwise, RXDRAWBITAMP returns an empty string (""). If pbid is ommitted, winid is assumed to be a valid window handle. Note: The use of VpLoadPictureHandle requires VisPro/Rexx. You must call VpLoadPicture and obtain the handle. Note: The use of DLLName, resource can be used by any PM REXX-based program, and retrieves the requested bitmap. If DLLname is in your LIBPATH, do not specify an extension of '.DLL'. VisPro/REXX Example: value = VpLoadPicture('FILE','C:\OS2\BITMAP\OS2LOGO.BMP') Call RxDrawBitmap window, 2000, value VX-REXX Example: window = VRGet("MyWindow", "HWnd") Call RxDrawBitmap window,, 'MYDLL', 3 Results: The Free Form window with ID=2000 in the window 'window' has the OS2LOGO bitmap drawn inside it. (For the VX-REXX example, the bitmap with number 3 in MYDLL.DLL is drawn in window 'MyWindow'.) Note: This API may work with other window types, it just has not been tested with them. ═══ 5.10. Clipboard Objects ═══ These APIs deal with the OS/2 Presentation Manager clipboard. They require a PM REXX-based program in order to function. ═══ 5.10.1. RxAppendClipboardText ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXAPPENDCLIPBOARDTEXT(──Text──)─── This function appends the text passed to the current contents of the clipboard. RXAPPENDCLIPBOARDTEXT returns the text previously in the clipboard if successful. If there is an error opening the clipboard, RXAPPENDCLIPBOARDTEXT returns "Error opening the clipboard". If there is no textual data in the clipboard, RXAPPENDCLIPBOARDTEXT sets the clipboard to contain the text passed. If there is an error setting the clipboard data, RXAPPENDCLIPBOARDTEXT returns "Error setting clipboard data". If there is not one valid string as the argument to RXAPPENDCLIPBOARDTEXT, the REXX error condition INCORRECT CALL TO ROUTINE is raised. Example: PrevText = RxAppendClipboardText("Stuff to add") Say 'The contents of the clipboard were "'PrevText'", and are now "'RxQueryClipboardText()'".' Results: The contents of the clipboard were "ABCD", and are now "ABCDStuff to add". Note: To get multiple lines into the clipboard, you should use a carriage return and linefeed combination at the end of the string. This can be achieved by the following code sample :- CrLfString = OldString || d2c(13) || d2c(10) ═══ 5.10.2. RxQueryClipboardText ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUERYCLIPBOARDTEXT()─── This function queries the current content of the clipboard. RXQUERYCLIPBOARDTEXT returns the text currently in the clipboard if successful. If there is an error opening the clipboard, RXQUERYCLIPBOARDTEXT returns "Error opening the clipboard". If there is no textual data in the clipboard, RXQUERYCLIPBOARD returns an empty string (""). Example: Text = RxQueryClipboardText() Say 'The contents of the clipboard are "'Text'".' Results: The contents of the clipboard are "This is in the clipboard". ═══ 5.10.3. RxSetClipboardText ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXSETCLIPBOARDTEXT(──Text──)─── This function sets the current content of the clipboard. RXSETCLIPBOARDTEXT returns "Clipboard set" if successful. If there is an error opening the clipboard, RXSETCLIPBOARDTEXT returns "Error opening the clipboard". If there is an error putting the data into the clipboard, RXSETCLIPBOARDTEXT returns "Error setting clipboard data". If there is not one valid string as the argument to RXSETCLIPBOARDTEXT, the REXX error condition INCORRECT CALL TO ROUTINE is raised. Example: Say RxSetClipboardText("New text for the clipboard") Say 'The contents of the clipboard are now "'RxQueryClipboardText()'".' Results: Clipboard Set The contents of the clipboard are now "New text for the clipboard". ═══ 5.11. Printing ═══ These APIs deal with accessing information to, from, or about printer queues. ═══ 5.11.1. RxQueueList ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUEUELIST(──stem──)─── Returns a list of print queues available for the workstation. If stem is not a valid string, or is omitted, RXQUEUELIST raises an INVALID CALL TO ROUTINE condition from within REXX. RXQUEUELIST fills the stem passed with the Print Queues available. stem.0 contains the number of queues available. stem.1 contains the first queue found, stem.2 contains the second queue, up to stem.n contain ing the nth queue, where n = stem.0. stem.n.DRIVERNAME holds the print driver associated with the nth queue. This will be needed for other printer API calls, as the Queue Name may not be unique. stem.default returns the index of the default queue (from 1 to stem.0). Example: Call RxQueueList 'queues.' Do i = 1 to queues.0 Say 'Queue 'i' is 'queues.i End def = queues.default Say 'The default print queue is 'queues.def Say 'The driver for this queue is 'queues.i.drivername Output: Queue 1 is Printer Queue 2 is Apple LaserWriter Plus on COM2 Queue 3 is Epson LQ-580 The default print queue is Apple LaserWriter Plus on COM2 The driver for this queue is PSCRIPT.Apple LaserWriter ═══ 5.11.2. RxQueueSetDefault ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUEUESETDEFAULT(──queueAndDriverName─)─── Sets the default print queue for a workstation. The parameter passed is the queue name concatenated to the driver name with a period. To produce this name from the stem returned by RxQueueList using the following code :- queueAndDriverName = queues.1 || '.' || queues.1.drivername If queueAndDriverName does not exist, RXQUEUESETDEFAULT raises an 'Incorrect call to routine' condition. See also RxQueueList for the correct way of obtaining queue and driver names. Example: Call RxQueueSetDefault 'Apple LaserWriter Plus on COM2.PSCRIPT.Apple LaserWriter' Output: The default queue will be changed to the Apple Laser Writer queue. ═══ 5.11.3. RxQueueJobProperties ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUEUEJOBPROPERTIES(──queueAndDriverName──)─── Asks the queue specified to display a 'Job Properties' dialog for the user, so that they can tailor options for an imminent print job. The parameter passed is the queue name concatenated to the driver name with a period. To produce this name from the stem returned by RxQueueList using the following code :- queueAndDriverName = queues.1 || '.' || queues.1.drivername If queueAndDriverName does not exist, RXQUEUEJOBPROPERTIES raises an 'Incorrect call to routine' condition. See also RxQueueList for the correct way of obtaining queue names and driver names. This function requires a Presentation Manager program to work correctly. Example: Call RxQueueJobProperties 'Apple LaserWriter Plus on COM2.PSCRIPT.Apple LaserWriter' Output: A job properties dialogue is displayed. ═══ 5.11.4. RxQueueWriteStem ═══ ┌─────────┬───────────┬───────┐ │.........│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXQUEUEWRITESTEM(──queueAndDriverName, stem──)─── Writes the entries stem.1, stem.2, stem.3 to stem.n where n = stem.0, to the Queue identified by queueAndDriverName. The first parameter passed is the queue name concatenated to the driver name with a period. To produce this name from the stem returned by RxQueueList using the following code :- queueAndDriverName = queues.1 || '.' || queues.1.drivername If queueAndDriverName does not exist, or a stem is not specified, RXQUEUEWRITESTEM raises an 'Incorrect call to routine' condition. stem.jobname specifies the name that is to appear in the printer queue for this print job. stem.priority specifies the priority (1 to 99) that is to be given to this print job. stem.copies specifies the number of copies of this print image to be printed. See also RxQueueList for the correct way of obtaining queue names and driver names. This function requires a Presentation Manager program to work correctly. Example: temp.0 = 3 temp.1 = 'A line of print' temp.2 = 'may not be worth the paper it is printed on....' temp.3 = ' Beware' temp.priority = 50 temp.jobname = 'My Quote' temp.copies = 1000 Call RxQueueWriteStem 'Apple LaserWriter Plus on COM2.PSCRIPT.Apple LaserWriter', 'temp.' Output: One THOUSAND COPIES of the 3 line quote are produced on an Apple LaserWriter Plus printer. All text longer than one line is wrapped, and if the text is more than one page, multiple pages are written out. ═══ 5.12. Event synchronisation and Resource Serialisation ═══ These APIs deal with synchronising threads and processes using events and serialising access to resources. The APIs are implemented using OS/2's semaphore support. An event corresponds to an Event Semaphore and a resource corresponds to a Mutex Semaphore. ═══ 5.12.1. RxEventCreate ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXEVENTCREATE(──name──┬──────────────┬──)─── └──,status─────┘ Creates an event used for process or thread synchronisation. If the name or status (if passed) are invalid strings, RXEVENTCREATE raises an INCORRECT CALL TO ROUTINE from within REXX. RXEVENTCREATE returns a handle which uniquely identifies the event if successful, or "Error creating event" if unsuccessful. The handle returned is for use with RxEventDestroy. Example: hEvent = RxEventCreate('FileLoad') Output: An event called 'FileLoad' is created and a handle to it is returned in hEvent. ═══ 5.12.2. RxEventDestroy ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXEVENTDESTROY(──handle──)─── Destroys the event used for process or thread synchronisation. If the handle is not passed, RXEVENTDESTROY raises an INCORRECT CALL TO ROUTINE from within REXX. RXEVENTDESTROY returns "" if successful. A valid handle is obtained when the event is created, using RxEventCreate. Example: Call RxEventDestroy hEvent Output: An event called 'FileLoad' which was previously created, and whose hand is stored in hEvent is destroyed and a NULL string is returned. ═══ 5.12.3. RxEventWaitFor ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXEVENTWAITFOR(──name──┬──────────────┬──)─── └──,timeout────┘ Waits for the event name used for process or thread synchronisation to occur. The REXX program that calls this function is blocked until either the event occurs, or the timeout period expires. If the name is not passed, RXEVENTDESTROY raises an INCORRECT CALL TO ROUTINE from within REXX. RXEVENTWAITFOR returns "Event occurred" if successful, "Timeout waiting for event", "Interrupted waiting for event", "Error waiting for event" if there is an error during waiting, or "Error finding event" if the event name is incorrect. Example: Call RxEventWaitFor 'FileLoad', 500 Say result Output: An event called 'FileLoad' which was previously created is waited on for 1/2 a second. The REXX special variable result holds the value returned by the function call. ═══ 5.12.4. RxEventOccurred ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXEVENTOCCURRED(──name──)─── Notifies any waiting programs that the event name has occurred. This tells all waiting programs to continue execution. Programs wait for an event by calling RxEventWaitFor. If the name is not passed, RXEVENTOCCURRED raises an INCORRECT CALL TO ROUTINE from within REXX. RXEVENTOCCURRED returns "" if successful, "Error finding event" if the event name is incorrect, or "Event already in 'occurred' state" if the event named has already occurred without being reset by RxEventReset. Example: Call RxEventOccurred 'FileLoad' Output: An event called 'FileLoad' which was previously created is marked as 'occurred' and a NULL string is returned. All programs waiting on this event with RxEventWaitFor continue execution. ═══ 5.12.5. RxEventQuery ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXEVENTQUERY(──name──)─── Returns the number of times an event has occurred since being reset. Programs reset an event by calling RxEventReset. If the name is not passed, RXEVENTQUERY raises an INCORRECT CALL TO ROUTINE from within REXX. RXEVENTQUERY returns a number if successful, "Error finding event" if the event name is incorrect, or "Error querying event" if some other error occurs. Example: numTimes = RxEventOccurred('FileLoad') Say 'The file was loaded' numTimes' times.' Output: The file was loaded 5 times. ═══ 5.12.6. RxEventReset ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXEVENTRESET(──name──)─── Resets an event so that it is in a 'Waiting' state and sets the count of event occurrences back to zero. If the name is not passed, RXEVENTRESET raises an INCORRECT CALL TO ROUTINE from within REXX. RXEVENTRESET returns "Event occurred n times since last reset" if successful (n is a number), "Error finding event" if the event name is incorrect, or "Event already in 'reset' state" if the event named has already been reset. Example: Say RxEventReset('FileLoad') Output: Event occurred 5 times since last reset ═══ 5.12.7. RxResourceCreate ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXRESOURCECREATE(──name──┬──────────────┬──)─── └──,status─────┘ Creates a resource used for process or thread serialisation. If the name or status (if passed) are invalid strings, RXRESOURCECREATE raises an INCORRECT CALL TO ROUTINE from within REXX. RXRESOURCECREATE returns a handle which uniquely identifies the event if successful, or "Error creating resource" if unsuccessful. The handle returned is for use with RxResourceDestroy. Example: hRes = RxResourceCreate('FileWrite') Output: A resource called 'FileWrite' is created and a handle to it is returned in hRes. ═══ 5.12.8. RxResourceDestroy ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXRESOURCEDESTROY(──handle──)─── Destroys the resource used for process or thread serialisation. If the handle is not passed, RXRESOURCEDESTROY raises an INCORRECT CALL TO ROUTINE from within REXX. RXRESOURCEDESTROY returns "" if successful. A valid handle is obtained when the event is created, using RxResourceCreate. Example: Call RxResourceDestroy hResource Output: A resource called 'FileWrite' which was previously created, and whose handle is stored in hResource is destroyed and a NULL string is returned. ═══ 5.12.9. RxResourceRequest ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXRESOURCEREQUEST(──name──┬──────────────┬──)─── └──,timeout────┘ Waits for the resource name used for process or thread serialisation to become available. The REXX program that calls this function is blocked until either the resource becomes available, or the timeout period expires. If the name is not passed, RXRESOURCEREQUEST raises an INCORRECT CALL TO ROUTINE from within REXX. RXRESOURCEREQUEST returns "Resource available" when the resource becomes available, "Error finding event" if the event name is incorrect, or "Timeout waiting for resource" if the timeout period expires, "Interrupted waiting for resource" if OS/2 interrupts the request, or "Error waiting for resource" if there is an error during the request. Example: Say RxResourceRequest 'FileWrite' Output: Resource Available The REXX program is suspended until the resource 'FileWrite' is available. ═══ 5.12.10. RxResourceRelease ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXRESOURCERELEASE(──name──)─── Releases the named resource so that the next waiting program can obtain access to the resource. If the name is not passed, RXRESOURCERELEASE raises an INCORRECT CALL TO ROUTINE from within REXX. RXRESOURCERELEASE returns "" if successful, "Error finding resource" if the resource name is incorrect. Example: Call RxResourceRelease 'FileWrite' Output: The resource called 'FileWrite' which was previously created is released so that other programs or threads can access it. Only one thread can obtain the resource at any point in time. ═══ 5.12.11. RxResourceQuery ═══ ┌─────────┬───────────┬───────┐ │OS/2 REXX│VisPro/REXX│VX-REXX│ └─────────┴───────────┴───────┘ ───RXRESOURCEQUERY(──name──)─── Returns the number of threads that are waiting for a resource. If the name is not passed, RXRESOURCEQUERY raises an INCORRECT CALL TO ROUTINE from within REXX. RXRESOURCEQUERY returns a number if successful, "Error finding resource" if the resource name is incorrect, or "Error querying resource" if some other error occurs. Example: numWaiters = RxResourceQuery('FileWrite') Say 'There are' numWaiters' threads waiting to write to the file.' Output: There are 5 threads waiting to write to the file. ═══ RxEventCreate name, status ═══ The status parameter should be either 'Occurred' or 'Waiting'. Only the first character is significant, and defaults to 'Waiting'. ═══ RxEventWaitFor name, timeout ═══ The timeout parameter should be either a time specified in milliseconds or 'Forever'. Only the first character of 'Forever' is significant. 'Forever' is the default. ═══ RxResourceCreate name, status ═══ The status parameter should be either 'Owned' or 'Unowned'. Only the first character is significant, and defaults to 'Unowned'. ═══ RxResourceRequest name, timeout ═══ The timeout parameter should be either a time specified in milliseconds or 'Forever'. Only the first character of 'Forever' is significant. 'Forever' is the default. ═══ 6. RxExtras.LIB ═══ RxExtras.LIB is a library file for use in C programming. If you want to use some of the functions in RxExtras in your own C code, you need to link with RxExtras.LIB when you are building your application. All functions exported from RxExtras.LIB are callable from REXX and therefore have the following function prototype :- ULONG Name(PSZ pszFnName, ULONG ulArgc, RXSTRING rxArgv[], PSZ pszQName, PRXSTRING prxReturn) The following is a list of all functions exported in RxExtras.LIB o RxRead o RxWrite o RxBootDrive o RxVolumeLabel o RxVarDump o RxStemCopy o RxExtra o RxSort o RxSwitchTo o RxQuerySwitchlist o RxListBoxFromFile o RxListBoxFromStem o RxQueryDriveType o RxSearchPath o RxGetItemFromListBox o RxSetSpinButtonRangeWithIncrement o RxSetSpinButtonCharRange o RxSetSpinButtonRangeFromStem o RxGetItemFromListBoxAtIndex o RxSetGlobal o RxGetGlobal o RxGetListBoxCount o RxListBoxToFile o RxListBoxToStem o RxAddItemAtIndex o RxMorphButtonToIcon o RxSearchItem o RxSetAccelTable o RxQueryAccelTable o RxQueryWindow o RxQueryClassName o RxQueryFonts o RxLineCount o RxMaximize o RxMinimize o RxRestore o RxThread o RxKillThread o RxSuspendThread o RxResumeThread o RxSetThreadClass o RxChangeThreadPriority o RxSetIcon o RxDrawBitmap ═══ 7. RxExtras.CMD ═══ RxExtras.CMD is a command file that will test all parts of RxExtras that can be run from the command line. A copy of this file is included here in case you delete it. You can easily copy the file from the Services->Copy menu item on the action bar and then paste it back into your favourite editor. ═══ 7.1. RxExtras.CMD - Source ═══ /* RxExtras - test for all functions in RxExtras.DLL */ Address CMD /* rcy = RxFuncDrop('RxExtra') */ If RxFuncQuery('RxExtra') <> 0 Then rcy = RxFuncAdd('RxExtra', 'RxExtras', 'RxExtra') Call RxExtra "Drop" /* Drop everything */ rcy = RxFuncAdd('RxExtra', 'RxExtras', 'RxExtra') Say 'Using version 'RxExtra("Load")' of RxExtras' Say Say "Testing RxBootDrive and RxRead..." Call RxRead 'stem.', RxBootDrive()":"'\CONFIG.SYS' Say "Your Config.Sys file should now appear" "@PAUSE" Do i = 1 to stem.0 Say stem.i end /* do */ "@PAUSE" Say Say "Testing RxBootDrive by itself" Say 'Your bootdrive is 'RxBootDrive()":" "@PAUSE" temp.0 = 5 temp.1 = "This is a test file" temp.2 = "With this ring, I thee bed" temp.3 = "The worlds smallest handcuff" temp.4 = "How to win fiends and affluent people" temp.5 = "### The last line ###" Say Say "Testing RxWrite by writing 5 lines to \TEMP.DAT" Call RxWrite "temp.", "\temp.dat" Say "Here is \TEMP.DAT" "@type \temp.dat | more" "@PAUSE" "@DEL \temp.dat" Say Say "Testing RxVolumeLabel" Say "Label of C is "RxVolumeLabel("C") "@PAUSE" Say Drop stem. Drop temp. temp.1 = 1 temp.testing = "Testing is on" temp.2 = 3 temp.testing.1 = "Life be in it" Say "Testing RxVarDump - dumping all 'local' variables" Call RxVarDump 'vars.' Do i = 1 to vars.0 Say 'Variable Name:"'vars.i.name'" has the value: "'vars.i.value'"' End Drop vars. "@PAUSE" Say Say "Testing RxStemCopy" Say "Copy all variables from temp. to temp2." Say "See RxVarDump above for temp. variables" Call RxStemCopy "temp.", "temp2." Say "Now we have..." Call RxVarDump 'vars.' Do i = 1 to vars.0 Say 'Variable Name:"'vars.i.name'" has the value: "'vars.i.value'"' End Drop vars. "@PAUSE" Say Say "Testing RxSort" temp.0 = 16 temp.1 = "This is a list" temp.2 = "a List should be sorted" temp.3 = "upper and Lowercase" temp.4 = "$trange" temp.5 = "#unny" temp.6 = "@nd unusual" temp.7 = "12345" temp.8 = "123456" temp.9 = "One isthe 9" temp.10 = "Ten green bottles 10" temp.11 = "Legs 11" temp.12 = "And then some 12" temp.13 = "Hollow weeing 13" temp.14 = "Only 14" temp.15 = "15" temp.16 = "The last line!" Say Say "The unsorted list is..." Say Copies('-', 50) Do i = 1 to temp.0 Say temp.i end /* do */ Say Copies('-', 50) "@PAUSE" Say Say "Sorting in descending order gives..." Call RxSort 'temp.', 'Descending' Say Copies('-', 50) Do i = 1 to temp.0 Say temp.i end /* do */ Say Copies('-', 50) "@PAUSE" Say Say "Sorting in ascending order gives..." Call RxSort 'temp.', 'Asc' Say Copies('-', 50) Do i = 1 to temp.0 Say temp.i end /* do */ Say Copies('-', 50) "@PAUSE" Say Say "Testing RxSwitchTo" Say "Switching to the desktop, hit Ctrl-Alt-Shift-O to see developers" /* RxSwitchTo works by matching as much of the string as you give it * to the first session. * i.e. Call RxSwitchTo "System C" * Will switch to the system clock. */ Call RxSwitchTo "OS" If POS("Switch", result) <> 0 Then Do /* probably 2.1 */ Call RxSwitchTo "Desktop" End "@PAUSE" Say Say "Testing RxQuerySwitchListo" Say "The programs running should now appear." Call RxQuerySwitchList "temp." Do i = 1 to temp.0 Say "Title: "temp.i ", Hwnd: "temp.i.hwnd", Process Id: "temp.i.pid End /* do */ "@PAUSE" Say Say "Testing RxQueryDriveType for Drive C:" Say RxQueryDriveType("C:") "@PAUSE" BD = RxBootDrive() PathToSearch = BD":\OS2;"BD":\OS2\INSTALL" Say Say "Testing RxSearchPath looking for DATABASE.TXT in \OS2 and \OS2\INSTALL" Say RxSearchPath(PathToSearch, 'DATABASE.TXT') "@PAUSE" Say Say "Testing Global variables" Call RxSetGlobal "SETTINGS.TX1", "This is shared memory!" Say "The text 'This is shared memory!' should now appear..." Say RxGetGlobal('settings.tx1') "@PAUSE" Say Say "Testing RxLineCount" LC = RxLineCount(RxBootDrive()':\config.sys') Say 'There are 'LC' lines in the your CONFIG.SYS file' "@PAUSE" Say Say "Testing RxGetEXEName" Say "The command line for this program was '"RxGetEXEName()"'" "@PAUSE" Say Say "Testing RxNap" Say "This program should appear to sleep for half a second" Call RxNap 500 "@PAUSE" Say Say "Testing RxFileExists" If (RxFileExists(RxBootDrive()":\CONFIG.SYS")) Then Say "I found your CONFIG.SYS!" "@PAUSE" Say Say "Testing RxKillProcess" Say "Please note the following output for processes to kill" Say "(and remember to convert the process from hex to decimal)" "@PSTAT /C | MORE" Call Charout ,"Enter a process id to be killed ?" Parse Pull id Say "Kill process returned: "RxKillProcess(id) "@PAUSE" Say Say "Testing RxAddFileHandles" Say "There are currently "RxAddFileHandles(0)" handles available." Say "Now adding 25 more. Now "RxAddFileHandles(25)" handles available." "@PAUSE" Say Say "Testing RxSetFileHandles" Say "There are currently "RxAddFileHandles(0)" handles available" Say "Now setting this to 100." Call RxSetFileHandles 100 Say "Now "RxAddFileHandles(0)" handles available." "@PAUSE" Say Say "Testing RxMatchWildCard" MF = 'MYFILE.cmd' WC = '*.cmd' Result = RxMatchWildCard(MF, WC) If Result = MF Then Say ' 'MF' matches Wildcard 'WC' (Edited name is:'Result')' Else Say ' 'MF' does not match Wildcard 'WC' (Edited name is:'Result')' MF = 'MYFILE.cmd' WC = '*.bbb' Result = RxMatchWildCard(MF, WC) If Result = MF Then Say ' 'MF' matches Wildcard 'WC' (Edited name is:'Result')' Else Say ' 'MF' does not match Wildcard 'WC' (Edited name is:'Result')' Say Say "All testing is now over..." "@PAUSE" Call RxExtra "Drop" ═══ 8. Registration/Support ═══ Registration Support Future Enhancements Trademarks ═══ 8.1. Registration ═══ This software package is distributed as Shareware. Non-corporate users are granted the right to use and evaluate the usefulness of RxExtras, and to distribute the package, intact, by any medium. Continued use of RxExtras requires formal registration of the software. Distribution of any software which requires RxExtras APIs by persons who have not paid their registration fee is illegal. Users acquiring a software package which requires RxExtras may freely use RxExtras with that package without being required to submit payment for RxExtras. However, such Users are required to pay for RxExtras if the User creates his/her own programs which utilize the RxExtras APIs. If you find this package useful and use it, register for $25 Australian ($18 US approx) at the address below by faxing, emailing or calling with your credit card details, or by sending a money order for the US dollar amount to the address below. Use of this package in any commercial product is illegal without registration and licensing. License arrangements can be made via: o Compuserve (100026,470) o Internet (10026.470@compuserve.com) o Voice Telephone (61-2-904-1988) o FAX Telephone (61-2-953-9401) o Mail: Dion Gillard 162 Ben Boyd Rd, Neutral Bay, NSW, 2089 Australia ═══ 8.2. Support ═══ If you have any questions or would like some other functions added, please contact me on Compu$erve (100026,470) or via Internet at 100026.470@compuserve.com ═══ 8.3. Future Enhancements ═══ If you have any ideas for future improvement of RxExtras, please contact me with your suggestions. Some of the ideas I am considering in future releases are: Function Description VX-REXX insert code Insert code function for VX-REXX WORDX A version of REXX's WORD function that uses any delimiter specified (e.g. commas), rather than just a space. REPLACE Replace a string within another string RxReplace Replace a given string of text with another in a file. RxFind Find file(s) which have a given string of text within them. RxRun Start a thread of execution within the current session. RxKillDir Delete a subdirectory, all of its files, and all of its subdirectories. ═══ 8.4. Trademarks ═══ VisPro/Rexx is a registered trademark of HockWare, Inc. VX-Rexx is a registered trademark of Watcom, Inc. RxExtras is copyrighted Dion Gillard, 1992 1993. CompuServe is a registered trademark of CompuServe, Inc.