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



Jon, isn't this what "VALUE" means?
I have long advocated that RPG should have const-and-I-mean-it whereby a copy is _always_ made. Then const would mean what most people already think it means!



On 6/16/12 9:22 AM, Jon Paris wrote:
On 2012-06-15, at 7:36 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

What exactly scenario can you change the contents of a parameter that uses Const? If there's a scenario, open a PMR.
Const means different things in the caller and the callee.

In the caller it means make a copy if the datatype/size does not exactly match.

In the callee it means read-only.

As a result regardless of what the caller codes, if the callee does not code const, the values can be changed. Whether the caller "sees" those changes or not depends on whether a copy was made. Since RPG III, CL, and COBOL have no proto capability then coding const in the caller really offers no protection. But a lot of people mistakenly think that by coding const that they are safe from any and all callee changes.

I have long advocated that RPG should have const-and-I-mean-it whereby a copy is _always_ made. Then const would mean what most people already think it means!


Jon Paris

www.partner400.com
www.SystemiDeveloper.com





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.