I am confused. I thought that was exactly what VALUE meant.
VALUE means pass a copy of the actual data (as opposed to a pointer which is
what happens with CONST). So it works well for small parms but is
problematic for large ones.
CONST does not mean I guarantee this value will not be changed. Just
that I will try.
I would use the term "that is my intent" rather than "try" but that's
semantics. The caller's view and the callee's view are different. CONST
for the caller means "I don't want him to change it" - from the callee's
perspective he gets a pointer (which may or may not be to the original
field) and if there is no PI/PR (matching the caller's PR) present, there's
nothing to stop him from changing the data.
To the best of my knowledge there is nothing "special" about the pointer
that prevents you copying/modifying the address or pretty much anything else
if the parm is not CONST protected. I suspect that what Bob is thinking
about is that there are restrictions placed by the compiler on the use/abuse
of the pointer _if_ there is a CONST proto definition for the parm. This
includes not being able to pass the parm on to other programs/procedures
that do not include CONST on the parm definition. But these are RPG
restrictions not the system.
Jon Paris
Partner400
www.Partner400.com
As an Amazon Associate we earn from qualifying purchases.