× 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.



Thanks Barbara,

Sorry, I cast my conclusions onto your statements :-)

I was trying to say the same thing and failed... what I was doing with
the unpassed parameter was changing the value to a default... by using
const rather than value I'm forced to use a local variable instead for
my defaults and changing it only if the parm is passed, so we end up in
the same place.  I'm not saying this is the only way to do it, but I'm
trying to develop some shop standards for myself and this is now how I
do things.

I still contend, however, that if you are allowed to use value and
*nopass together, then the program should allocate memory for the
variable as if it were a local variable since you are most definitely
allowed to change the value.  

Joel
http://www.rpgnext.com


On Thu, 2003-08-07 at 18:37, Barbara Morris wrote:
> Joel Cochran wrote:
> > 
> > One caveat that Barbara Morris pointed out to me is that using "value"
> > and "options(*nopass)" on the same variable can be dangerous.  If you
> > want a variable to be *nopass and still take advantage of the VALUE
> > benefits, then use CONST...
> > 
> 
> Joel, just to clarify, it's ok to use VALUE and options(*nopass)
> together as long as you make sure the parameter was passed before using
> it.  But with CONST, you shouldn't refer to the parameter if it wasn't
> passed, either.  So I don't think there's any reason not to use VALUE
> and OPTIONS(*NOPASS).
> 
> (The dangerous thing you were doing was using the unpassed parameter as
> though it was a local variable.)
> 
> _______________________________________________
> 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 thread ...

Replies:

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.