× 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've done it often enough, but I've always been "uncomfortable" passing data structures as parameters, because of the fact that the subfields of the data structure must be defined the same way in the caller program and the called program.

You can define all the subfields as separate parameters instead of subfields, and we see from Barb's example that this gives the subprocedure creator (you the developer) more control over its attributes and behavior in the prototypes.

aec


On 6/15/12 7:36 PM, Barbara Morris wrote:
On 2012/6/15 5:25 PM, Anderson, Kurt wrote:
What exactly scenario can you change the contents of a parameter that
uses Const? If there's a scenario, open a PMR.

If you pass a subfield as CONST, and also pass its data structure by
reference, then modifying the subfield of the data structure parameter
would cause the CONST parameter to also get modified.

Another way to legally modify the value of a CONST parameter is for the
procedure to modify the global variable that was passed as the parameter.

As Jon said, passing a parameter by value is the only way to guarantee
the parameter can't get changed by modifying something that shares the
same storage as a const parameter. But that wouldn't help Robert, since
Robert wanted to prevent the subfield being modified at all.

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.