|
Rory, It's not really a question needing OPTIONS(*NOPASS:*OMIT). It's a question of being as flexible as possible for the caller. The caller could use: Myproc(var1:var2); Myproc(var1:var2:*OMIT:var4); Myproc(var1:var2:*OMIT:*OMIT:var5); This way the caller doesn't have to pass some default value for parm3 or parm4 when all they really want to pass is parm4 or parm5. In addition, by doing it this way, the callee gets to determine what the "default" values should be. Which makes it easy to change if need be. Note: I didn't come up with this idea, I think I first heard about such usage from Scott Klement. 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 Rory Hewitt Sent: Wednesday, November 01, 2006 1:23 PM To: RPG programming on the AS400 / iSeries Subject: Re: Calling an RPG procedure with optional parameters from C code Charles, Under what circumstances would you do this? I can see some (rare, I'd think) cases where you'd need both (where you a number of optional parameters and you might want to pass one or more of the later parameters (e.g. an error parameter like QUSEC)) but not the earlier ones, but if that's the case, I'd think you'd be better off redoing the parameter order. I can only think of two instances where I've needed to use both *OMIT and *NOPASS for a parameter. Although this could just mean that my procedures are simple compared to your :-) Rory On 11/1/06, Wilt, Charles <CWilt@xxxxxxxxxxxx> wrote:I often code parameters as options(*NOPASS:*OMIT). Charles Wilt-- 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-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.