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



There a benefits to using both.
Hard rules are silly at best, so I'll try not to impose any in this response.

For the most part, using CONST is correct in the situation you described.
However, the caveat to that "rule" should be as follows:

Always use CONST and justify why you need to change the parameter value.

This simply means, try to use CONST, but it does not mean "always use CONST."
There is rarely a reason to use VALUE instead of CONST in the RPG World.
There is rarely a reason to use CONST instead of VALUE in the RPG World.
But "rarely" does not mean "never", and it also doesn't mean "always".

I had an instructor once tell me to never use EXSR in my RPGII code. The real
reason was because he didn't know what it was or why it was used.
Sounds like the CONST rule at your company.


-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of David Foxwell
Sent: Monday, May 07, 2007 10:58 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Another ILE question : CONST vs VALUE

Here's another one I can't get my head round.

I understand the difference between passing parameters by reference and by
value.

When we started ILE, the powers that be imposed on us the keyword CONST
systematically for all parameters destined to be used as input parameters.

That way, you can't change the parameter in your program. YOU can't but your
programme certainly can!.

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.

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.