An add-on library also contains functions that your REXX script can call. These are not built-in functions like TIME(), LEFT(), POS(), DATE(), LINEOUT(), etc. (They are not inside of your REXX interpreter). Rather, they are "extra" functions that are inside of a separate DLL file. For example, REXX GUI has a DLL file (REXXGUI.DLL) that contains extra functions to create windows with menus, sliders, buttons, etc. An example of one of the function's in REXX GUI's DLL is GuiCreateWindow().

Unlike the built-in functions, these "extra" functions are not automatically available to your script. Before your script can call some function in a DLL, you must first register that DLL's functions once. If you do not register the functions before you try to call them, then your REXX interpreter will give an error.

REXX has a built-in function that you use to register a DLL's functions. This built-in function is named RXFUNCADD(). For DLLs designed specifically for Reginald, you call it as so:

OPTIONS 'C_CALL'
DO
   RXFUNCADD('dllname')

   CATCH FAILURE
      CONDITION('M')
   RETURN
END
'dllname' is the filename of the DLL file that contains the function. Do not put any .dll extension upon the name. For example, REXX GUI's DLL is named rexxgui.dll. (You'll need to consult the documentation with your add-on library to discover what is the name of its DLL file). Upon some operating systems, the DLL name may be case-sensitive. (ie, A DLL name of RexxGui is not the same as rexxgui).

Note: The Windows operating system does not have case-sensitive filenames (so RexxGui is the same as rexxgui).

Be sure to enclose the name in quotes if you're passing it as a literal string to RXFUNCADD().

If there is a problem registering the DLL's add-on functions, then an error message will be shown. See RXFUNCADD() for more details about errors.

After the above call to RXFUNCADD() (and it succeeds), you can then call GuiCreateWindow (and any other REXXGUI.DLL functions) as many times as you would like.