|
On Mon, 29 Apr 2013, at 12:54:28, Alan Campin <alan0307d@xxxxxxxxx> wrote:
As I have said many times, VALUE means the compiler says I guarantee that
variable in the calling program will not be changed and it does that by
making a copy and pass a pointer to it.
You may have said it many times Alan - but I'm afraid you're wrong. The
compiler does copy the value - but onto the stack. There is no pointer
passed. This is why using large values passed by Value is a bad idea. IBM
even implemented RTNPARM in V7 to help with large return values which
utilize the same underlying approach.
What you have described here is the behaviour of a CONST _when_ the data
type and/or size of the passed parm do not match the proto.
In the procedure you can do
anything you want with that parameter including changing it and it will
have no impact on the variable in the caller.
You are correct - but it is because of the fact that you receive a copy of
the data - no pointers involved.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.