× 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 actually not the OP. Though I did ask a question and that was in regard to Jon's comment about Const not really being a constant and that the value could still change. I was asking how that field could be changed, as I took the meaning of the statement that the field could be directly modified (thought maybe a certain bif was somehow getting around the restriction). I wasn't thinking about multiple variables pointing at the same point of memory and having one of those not being Const - which I am aware of (and was bitten by once).

I do appreciate the responses, however.

Thanks,
Kurt



From: roryhewitt@xxxxxxxxx [mailto:roryhewitt@xxxxxxxxx] On Behalf Of Rory Hewitt
Sent: Monday, June 18, 2012 3:37 PM
To: RPG programming on the IBM i / System i
Cc: Anderson, Kurt
Subject: Re: Explanation

Kurt,

FWIW, when I've hit anything like this scenario, I save a copy of the DS in the caller prior to the call and then copy back in the subfields I want to remain unchanged. I assume that's probably what you're doing here.

Rory
On Mon, Jun 18, 2012 at 12:52 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx<mailto:rpg400-l@xxxxxxxxxxxxxxxx>> wrote:
Hi Kurt,

Yeah, we've gone off on a tangent from your original question.

As others have already explained, with regard to your original question,
you either have to mark the parameter (i.e. the entire data structure)
as const or not const.

Passing the changable field in a separate parameter is about your only
option.

FWIW -- I don't know of any programming language (Java, PHP, C, C++,
etc) where you can pass a whole data structure (or object) so that the
called routine can change some parts but not others.

Sorry for any confusion, though... we went off on a tangent discussing
the "const and I really meant it" idea.

Good luck to you.

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.