× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Multiple parms to procedures
  • From: Hans Boldt <boldt@xxxxxxxxxx>
  • Date: Tue, 21 Jul 1998 08:23:21 -0400

mark wrote;
>What are the guidelines / differences using *OMIT over *NOPASS?

OPTIONS(*OMIT) can be used on any parameter in the procedure
prototype, except for VALUE parms.  When you want to omit a
parm when calling the procedure, code *OMIT as the parameter.

OPTIONS(*NOPASS) can be specified for any parm, but they must
be at the end of the parameter list.  That is, if the 3rd parm
has OPTIONS(*NOPASS), then all remaining parms must also have
OPTIONS(*NOPASS) specified.  When calling the procedure and you
want to leave out a particular parm, all remaining parms must
also be left out.  You can't omit any parm in the middle of the
parameter list.

How to decide which one to use?  If you can group the parameters
so that the less commonly used parms can be left out, put them
at the end of the parm list and use *NOPASS.  If a number of
different combinations are equally likely, and it doesn't make
sense to pass multiple parms in one call, consider *OMIT.

Based on the function provided, it may make more sense to provide
several interfaces to the same procedure, each with a different
combination of parameters.  This may make more sense if each
different combination of parms you may want to pass has a
somewhat different purpose.  This may also help in maintenance
when enhancing the function of a procedure.  It may make sense
to enhance a procedure by adding a parameter.  But rather than
changing every call to that procedure, add a new procedure
that's identical to the old one including the new parms and
code, and change the old procedure to just call the new one.

Cheers!  Hans

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.