Home | OS/2 Software | Rexx | Renaming (or privatizing) Rexx functions

Renaming (or privatizing) Rexx functions

Contributed by: Wayne Swanson

An apparently little known trick is loading functions from dll's with personalized names. For the most part, experienced users of Rexx realize that if we "drop" the functions from RexxUtil.dll at the end of our programs we can cause trouble for any other program that is running at the time and still needs them.

So maybe you wanted to use just one function from RexxUtil.dll and drop it right afterward. Most of you probably know that you can load just one function at a time with the RxFuncAdd call but did you know you can rename it to almost anything you want too? This can help you avoid causing problems for another program while letting you feel good about yourself for cleaning up afterwards.

In this example we will assume that we want to use only the SysBootDrive function from RexxUtil. We will rename it to "BobsBootDriveFinder" so we can "drop" it when we are done and not affect any other programs that may need the "SysBootDrive" call. (Be sure to use a name that is unique. BTW: I already have the Copyright on "BobsBootDriveFinder" [Big grin])

Snip the following and run it at the command line for an example.


 

/* test */
call RxFuncAdd "BobsBootDriveFinder", "REXXUTIL", "SysBootDrive"
say BobsBootDriveFinder()

rc = RxFuncDrop(BobsBootDriveFinder)