|
On 10/5/2016 3:15 PM, Barbara Morris wrote:an
...
You could use a C module for your main procedure. A C main gets its
parameters as an array of pointers. You could use this C module as the
program-entry module for any program where you want the parameters as
namearray. You just have to name the RPG procedure RPGMAIN (or whatever
you use in the C module).
...
// RPG "main"
ctl-opt nomain;
dcl-proc RPGMAIN export;
dcl-pi *n;
argCount int(10) value;
argArr pointer dim(400) options(*varsize);
end-pi;
dcl-s i int(10);
for i = 1 to argCount;
if argArr(i) <> *null;
// do something
endif;
endfor;
end-proc;
I forgot to mention that you could also define a data structure with a
named pointer for each parameter, and base a variable of the required
type on each pointer. Then copy the passed pointers to that data
structure and process the pointers by name.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.