Loading RexxUtil at boot time

By Gordon Snider

I suggest this method of loading the RexxUtil.DLL at boot time. It is a modified version of a method found in Down To Earth REXX, (William F. Schindler, Perfect Niche, 2000).

In the book, this code is part of a subroutine called by each REXX command run. However, I wanted them loaded at boot time because I use the RexxUtil functions so often. That way, I wouldn't have to think about them.

The following code is put into its own .CMD file. I named this file LRU.CMD: /* Load the RexxUtil library */ IF RxFuncQuery( 'SysLoadFuncs') THEN DO  IF RxFuncAdd( 'SysLoadFuncs', 'RexxUtil', SysLoadFuncs') THEN SAY "Error: Couldn't load RexxUtil library." CALL SysLoadFuncs END EXIT

You may want to create a REXX folder, which would include LRU.CMD. If you do so, you'll need to add that folder to the PATH statement in your CONFIG.SYS file. (For example, my command folder is C:\CMD) You can put all your other REXX commands in this same folder for maximum convenience.

Then, you need to add a line to your STARTUP.CMD file to call LRU.CMD. In my case, it looks like this: CALL C:\CMD\LRU.CMD Note that this is a batch file CALL, not a REXX CALL. They are different. The batch file, STARTUP.CMD, calls the REXX CMD LRU.CMD. This seems to work just fine.

From now on, every time you boot the RexxUtil library will be loaded, ready to support REXX commands that use functions in that library. The DLL remains available to all REXX commands until you shut down the system.

The alternative, as described in the book, is to put the following code as a CMD file in your command folder and call it from each command that uses the RexxUtil functions.

/* Load the RexxUtil library */ LoadRexxUtil: PROCEDURE IF RxFuncQuery( 'SysLoadFuncs') THEN DO  IF RxFuncAdd( 'SysLoadFuncs', 'RexxUtil', SysLoadFuncs') THEN SAY "Error: Couldn't load RexxUtil library." RETURN 1 CALL SysLoadFuncs END RETURN 0

It is called this way as an external function: IF LoadRexxUtil THEN EXIT

The above code should be placed as the first non-comment clause in your REXX code.