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



Anyone else had this problem? What's the point of using CONST instead of
VALUE apart from performance issues? I'd say that if I see VALUE on a
parameter I'm sure that it wasn't intended to be changed in the procedure.

I suspect that this is a problem for you because you are still using a
*ENTRY PLIST instead of a PI. If you used a PI then the CONST rule would
also be enforced by the called program.

There may also be a slight misunderstanding of the meaning of CONST. Unlike
VALUE, CONST do _not_ guarantee that a copy of the parm will be passed. A
copy is only made if there is a parm mis-match (i.e. passing a 5,0 to a
program that expects a 7,0) - if the parm is an exact match then the
original is passed. As a result if the called program does not use a PI,
then the original field can indeed be changed by the called program.

I really wish the compiler would implement a CONST_AND_I_MEAN_IT option i.e.
the parm is always passed by copy. This is effectively what the old PARM
with Factor 2 did and it is missing from RPG IV as noted above.



Jon Paris
Partner400

www.Partner400.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.