APIRET APIENTRY TestFunction(CONST CHAR *name, ULONG numargs, RXSTRING args[], CONST UCHAR *queuename, RXSTRING *retstr) { retstr->strptr = 0; retstr->strlength = 0; /* Some interpreters require the strlength field 0 too */ return(RXFUNC_OK); }
If your function doesn't return a value, the REXX script must call your function like a subroutine. All this really entails is putting the CALL keyword in front of the name of the function, and omitting the parentheses around the arguments, as so:
CALL TestFunction 'Arg One', , MyVariable, "Arg 4";
NOTE: Reginald does away with this annoying behavior of REXX. Even if your function returns no data, a REXX script may still call it like a function (ie, without the CALL keyword, and using parentheses around the arguments). In this case, there is nothing to pass to any Subcom Handler, so it doesn't even matter whether the script includes the ADDRESS NULL statement.