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.