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



Wilt, Charles wrote:
...
Out of curiosity, why the limitation in the RPG compiler? Just to protect us from ourselves or some
other reason? The same data would be pushed onto the stack, so it would seem that the compiler could
allow a pointer by value parameter if it wanted to. Not that I can think of a good reason to do it
that way ;-)

Couldn't you do it with a C program?


Charles, you're right that the RPG compiler _could_ allow passing _pointers_ by value to programs. And I guess it might even be useful along with OPTIONS(*STRING).

With C, you can code as though you are passing the parameter by value, but if the by-value parameter for a program call (OS linkage) isn't a pointer, the C compiler automatically turns it into a by-reference parameter. I find this it very confusing; if you have an OS-linkage call with a pointer parameter and an int parameter, both by value, the pointer parameter will get passed by value, but the int parameter will get passed by reference.


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.