The new REXXUTIL DLL provided with Object-Oriented REXX contains some functions to work with the macro space (see New REXXUTIL functions in Object REXX). These functions return the following error codes:
okay, no error
Not enough memory
Macro not found
Extension required
Macro already exist
File error
Signature error
Sourcefile not found
Invalid position
Some further hints for these functions:
SysAddRexxMacro can only load one macro from a REXX cmd file at a time. You can't load a tokenized REXX program into the macro space using this function. SysAddRexxMacro overwrites an existing macro. The file with the REXX macro must have an extension -- SysAddRexxMacro doesn't find files without an extension.
SysLoadRexxMacroSpace can only load an image that was previously saved with SysSaveRexxMacroSpace. SysLoadRexxMacroSpace works only if the macro space is empty (thus you can't concenate two or more images in the macro space but AFAIK the number of macros in the image is not limited).
There's no function to get a list of all existing macros in the macrospace.
(see also LoadMac.cmd)