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



> From: sjl <sjl_abc@xxxxxxxxxxx>
> I have this page bookmarked:
> http://www.web400.com/download/ilerpg/subprocedure_parameters2.htm>

Jeff Young wrote:
Based on that info, CONST is enforced by the compiler ONLY if you are using sub-procedures.
If you are using an external service program or just another program, then using VALUE is the only way to ensure that the parameter will not be changed on return from the call.

Is this a correct summary?

Not exactly. It's more correct to say that CONST is only enforced if the called code uses a prototype to describe its parameters. Of course, prototype mismatches can throw a wrench in things, but that's what /copy is for.

Programs cannot receive parameters by value, at least up to V5R4. I don't know if the user-defined entry procedure feature in V6R1 changes that.


David Gibbs wrote:
> IIRC, it won't even let you get the address of a parameter passed as
> const (using %addr), so you can't do direct memory manipulation via a
> pointer.

Nor can you pass it to a program or procedure that does not specify CONST or VALUE, even if you use CALL+PARM.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.