|
Larry,
My understanding is that there is a difference between
MyProc(parm1:*omit);
MyProc(parm1)
In the first case, the address passed, via the call stack, for the 2 parm is
*NULL.
In the second case, nothing is passed. You can't test for it except by check
%parms to see how many parms were passed.
In other words, in the first case %parms = 2. In the second case %parms = 1.
When a parameter is declared with *OMIT and *NOPASS, you always have to check
both cases.
if %parm <=2; //check for nopass
if %addr(myParm2) <> *NULL; //check for *OMIT
// we have something to work with
endif;
endif;
//this doesn't work as it depends on some prior call having left zeros in the
call stack
if %addr(myParm2) <> *NULL;
// we don't really know what we have
endif;
Here's a good reference:
http://www.itjungle.com/fhg/fhg010505-story02.html
HTH,
Charles Wilt
--
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Larry Ducie
> Sent: Tuesday, July 26, 2005 4:15 PM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: RE: creating a new procedure that
> callanexistingprocedurewithoneadditional parm
>
>
> Hi Charles,
>
> <snip>
> I think it depends on what happens to be in memory at a
> particular location.
> </snip>
>
> My understanding is that passing *OMIT into the procedure in
> place of an
> omittable parm would set the address to null. If it didn't
> then *OMIT is a
> waste of time.
>
> For example, if you could omit ONLY the fourth of seven parms
> you've got no
> way of checking if it's passed without checking it's address
> - referencing
> the variable directly will cause an exception if it actually
> was omitted.
>
> Cheers
>
> Larry Ducie
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>
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.