75 const char *str1 =
"Arg number one";
76 const char *str2 =
"Arg number two";
77 const char *str3 =
"Arg number three";
78 const char *str4 =
"Arg number four";
79 const char *sync_tst =
"call time 'Reset';" \
80 "object1 = .example~new;" \
81 "object2 = .example~new;" \
82 "object3 = .example~new;" \
83 "a.1 = object1~start('REPEAT', 4 , 'Object 1 running');" \
85 "say 'The result method waits until the START message has completed:';" \
86 "a.2 = object2~start('REPEAT', 2, 'Object 2 running');" \
87 "a.3 = object3~start('REPEAT', 2, 'Object 3 running');" \
91 "say 'Elapsed time: ' time('E');" \
93 "::REQUIRES 'example.rex'";
106 printf(
"This is an easy sample of how to invoke the Rexx interpreter. \n");
107 printf(
"The Rexx commandfile which is started is named: startrx1.rex\n");
109 printf(
"Press Enter to continue\n");
126 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
127 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
128 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
132 printf(
"Press Enter to continue\n");
137 printf(
"In this case a previously defined Resultstring is \n");
138 printf(
"delivered to Open Object Rexx, which is large enough to \n");
139 printf(
"hold the Return Value of the Rexx commandfile\n");
141 printf(
"Press Enter to continue\n");
144 rexxretval.
strptr = (
char *) malloc(100 *
sizeof(
char));
158 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
159 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
160 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
164 printf(
"Press Enter to continue\n");
169 printf(
"In this case a previously defined Resultstring is \n");
170 printf(
"delivered to Open Object Rexx, which is too small to\n");
171 printf(
"hold the Return Value of the Rexx commandfile.\n");
172 printf(
"Rexx reallocates the buffer which needs to be freed\n");
173 printf(
"in the calling program\n");
175 printf(
"Press Enter to continue\n");
178 rexxretval.
strptr = (
char *) malloc(2 *
sizeof(
char));
179 pszTemp = rexxretval.
strptr;
182 printf(
"The Length of the Resultstring is %d\n",
int(rexxretval.
strlength));
195 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
196 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
197 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
201 printf(
"Press Enter to continue\n");
209 printf(
"This is a sample with 4 arguments delivered to \n");
210 printf(
"REXXSTART\n");
211 printf(
"The Rexx commandfile which is started is named: startrx2.rex\n");
213 printf(
"Press Enter to continue\n");
232 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
233 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
234 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
238 printf(
"Press Enter to continue\n");
243 printf(
"This is a sample with 2 arguments delivered to \n");
244 printf(
"REXXSTART\n");
245 printf(
"The Rexx commandfile which is started is named: startrx2.rex\n");
247 printf(
"Press Enter to continue\n");
264 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
265 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
266 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
270 printf(
"Press Enter to continue\n");
275 printf(
"This is a sample where the directory listing of the \n");
276 printf(
"actual directory is returned by the Rexx program. The \n");
277 printf(
"returned ResultString is displayed\n");
278 printf(
"The Rexx commandfile which is started is named: startrx3.rex\n");
280 printf(
"Press Enter to continue\n");
297 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
298 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
299 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
303 printf(
"Press Enter to continue\n");
308 printf(
"This is a sample where the instore parameter [0] is \n");
309 printf(
"tested. Instore parameter [0] is loaded with \n");
310 printf(
"a small Open Object Rexx script showing the concurrency feature.\n");
312 printf(
"Press Enter to continue\n");
315 instore[0].
strptr =
const_cast<char *
>(sync_tst);
316 instore[0].
strlength = strlen(instore[0].strptr);
331 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
332 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
333 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
337 printf(
"Press Enter to continue\n");
342 printf(
"Now instore[1] is loaded with the content of instore[0]. \n");
343 printf(
"It can be used on subsequent calls. instore[0] is set to NULL \n");
345 printf(
"Press Enter to continue\n");
362 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
363 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
364 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
369 printf(
"Press Enter to continue\n");
374 printf(
"This is a sample to show how to use the Rexx MacroSpace facility. \n");
375 printf(
"First of all load_macro.rex is called to load \n");
376 printf(
"the Rexx script macros.rex into Macrospace. The Macrospace- \n");
377 printf(
"name is upload.rex. \n");
379 printf(
"Press Enter to continue\n");
396 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
397 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
398 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
402 printf(
"Press Enter to continue\n");
407 printf(
"Now the Open Object Rexx script macros.rex (named upload.rex) has been loaded\n");
408 printf(
"into Macrospace. It is now used in the name option of\n");
409 printf(
"the REXXSTART command. \n");
410 printf(
"It is very important that instore paramenter [0] and [1] are\n");
411 printf(
"initialized to NULL rsp. 0 and used as REXXSTART parameters\n");
413 printf(
"Press Enter to continue\n");
435 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
436 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
437 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
441 printf(
"Press Enter to continue\n");
446 printf(
"Finally del_macro.rex is called to delete macros.rex (named upload.rex)\n");
447 printf(
"out of the Open Object Rexx Macrospace.\n");
449 printf(
"Press Enter to continue\n");
463 printf(
"CALLREXX1 - Back from REXXSTART: Return Code: %d\n", rc);
464 printf(
"CALLREXX1 - RESULT-LENGTH: %d\n",
int(rexxretval.
strlength));
465 printf(
"CALLREXX1 - RESULT-Value: %s\n", rexxretval.
strptr);
469 printf(
"Press Enter to continue\n");
int REXXENTRY RexxStart(size_t argcount, PCONSTRXSTRING arglist, const char *programname, PRXSTRING instore, const char *envname, int calltype, PRXSYSEXIT exits, short *retcode, PRXSTRING result)
RexxReturnCode REXXENTRY RexxFreeMemory(void *)
#define MAKERXSTRING(r, p, l)