|
Simon, In the OPTIONS(*NOPASS : *OMIT) case is there any reason you can't use the %parms and %addr together? At least that is how I do it, just curious because in the first part of your message you mentioned %addr was easier to use but you didn't use it here. Want to make sure I'm not missing something by doing the following: C IF ( %PARMS >= 2 ) and (%addr(TheParm) <> *NULL) *** The parm can be used. C ENDIF Scott Mildenberger > -----Original Message----- > From: Simon Coulter [mailto:shc@flybynight.com.au] > Sent: Monday, February 18, 2002 3:29 PM > To: rpg400-l@midrange.com > Subject: Re: Optional Parameters in Subproceedures > > If the parameter was coded as OPTIONS(*NOPASS : *OMIT) then > you MUST use > %PARMS followed by a call to CEETSTA to test for an omitted > argument. The > reason you must do it this way is that if the parameter was > not specified > at all CEETSTA will fail with a missing descriptor (or worse, > pick up a > descriptor on the stack from a previous function call). If *OMIT was > specified then %PARMS will count it as a parameter. You must > do both things > to know whether you have a valid parameter or not. > > C IF ( %PARMS >= 2 ) > C CALLP ceeTestArg( argOmitted : 2 : *OMIT ) > C ENDIF > > C IF ( %PARMS >= 2 AND > C argOmitted = $CEE_ARG_OMITTED_NO ) > * do stuff > >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.