The following is a sample external function definition:
Sample external function definition
ULONG SysLoadFuncs(
PSZ Name, /* name of the function */
LONG Argc, /* number of arguments */
RXSTRING Argv[], /* list of argument strings */
PSZ Queuename, /* current queue name */
PRXSTRING Retstr) /* returned result string */
Name
The REXX interpreter provides a default 256-byte RXSTRING in Retstr. A longer RXSTRING can be allocated with DosAllocMem if the returned string is longer than 256 bytes. The REXX interpreter releases Retstr with DosFreeMem when the external function completes.
If the external function does not have a return value, the function should set Retstr to an empty RXSTRING (NULL strptr). When an external function called as a function does not return a value, the interpreter raises error 44, "Function or message did not return data". When an external function called with the REXX CALL instruction does not return a value, the REXX interpreter drops (unassigns) the special variable RESULT.