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



Ok, it pushes it on to the stack. Better but not different. In either case
it has copy and you cannot change the original. the physical method that
the compiler uses is not the important point. They could change it tomorrow
to create a local variable and pass a pointer to and we would not know the
difference.


On Mon, Apr 29, 2013 at 4:22 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:


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