The following is a sample of macrospace usage:
Sample macrospace usage
/* first load entire package */
RexxLoadMacroSpace(0, NULL, "EDITOR.MAC");
for (i = 0; i < MACRO_COUNT; i++) { /* verify each macro */
/* if not there */
if (RexxQueryMacro(macroφi∙, &position))
/* add to list */
RexxAddMacro(macroφi∙, macro_filesφi∙,
RXMACRO_SEARCH_BEFORE);
}
/* rebuild the macrospace */
RexxSaveMacroSpace(0, NULL, "EDITOR.MAC");
.
.
.
/* build the argument string */
MAKERXSTRING(argv[0], macro_argument,
strlen(macro_argument));
/* set up default return */
MAKERXSTRING(retstr, return_buffer, sizeof(return_buffer));
/* set up for macrospace call */
MAKERXSTRING(macrospace[0],NULL, 0);
MAKERXSTRING(macrospace[1],NULL, 0);
return_code = RexxStart(1, /* one argument */
argv, /* argument array */
macro[pos], /* REXX procedure name */
macrospace, /* use macrospace version */
"Editor", /* default address name */
RXCOMMAND, /* calling as a subcommand */
NULL, /* no exits used */
&rc, /* converted return code */
&retstr); /* returned result */