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



I'm replying to several posts after this one -

If the prototype for a procedure has CONST on a parameter, the PI for it also has to have CONST - the compiler will not allow you to have a mismatch.

I suppose *ENTRY PLIST suffers from the lack of data checking that it always has. That is why I prefer to use a prototype and PI for the main procedure.

Now I don't remember putting CONST on a parameter to the main procedure - that's an interesting thought. Nor have I put VALUE on that.

OK - just did that kind of thing - here is a listing message when I tried to use VALUE - yes, it is maybe intuitively obvious that this is not possible, but hey, it's almost 7pm!

RNF3769 30 a 000600 The main procedure cannot use parameters passed by value.

The use of CONST there IS acceptable, because that is still a pointer. CALL to a program cannot use by-value - only by-reference.

Now can one directly modify a CONST parameter in the main procedure? Let's see!!

Nope!!

RNF5346 30 a 000900 Result of EVAL operation must not be a field that cannot be modified.
Hope that is helpful and useful in understanding CONST and VALUE a little bit more.

Time to go home or go eat!
Vern

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?

Thanks,

Jeff Young Sr. Programmer Analyst
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2 IBM Certified Specialist- e(logo) server i5Series Technical Solutions Designer V5R3
IBM Certified Specialist- e(logo)server i5Series Technical Solutions Implementer V5R3

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.