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



A parameter passed by reference can be changed.
Can it be returned? It depends on what you mean.
As written I'm guessing you're doing this:

D myProc   PI             32A
D  inparm                 32A  OPTIONS(*VARSIZE)
C           Eval    inParm = 'ABCDEFG'
C           return  inParm

Is that what you're trying to do?
If you change inParm, then the value in the variable used when calling
MyProc is changed because it is the same storage you are changing, just
like *ENTRY/PLIST in a regular CALL to a program. There is no reason to
do a RETURN opcode.

Having said that, if you are using the above techinque, I'm not certain
if it is simply a compiler bug/error or not, but I'm sure Hans or
Barbara will be able to answer that question.

Bob Cozzi

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On Behalf Of JJW
Sent: Monday, November 25, 2002 9:39 AM
To: rpg400-l@midrange.com
Subject: Passing By Reference


Hi *ALL

I pass a parameter with option(*varsize) to a subprocedure
of a service program by reference.  I modify the parameter
and upon trying to return the parameter to the calling
program I get a pointer not set error.  I can however move
the parameter to a field defined LIKE the parameter,
change the like field and pass that field back with no
problem.

Is it true that a parameter passed to a subprocedure by reference cannot
be changed and returned?

TIA!!!

John
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@midrange.com To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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.