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



Here is the code piece:
// ...................... Prototype
D GETDIVR PR
D 2
D 30
// ....................... Procedure interface
D GETDIVR PI
D pDiv like(DIV)
D pDivName like(DIVNAME)

// ....................... Mainline
C* *ENTRY PLIST
C* PARM DIV 2
C* PARM DIVNAME 30
/FREE
// fill DIV & DIVNAME for return
DIV = '11';
DIVNAME = 'Division Name';
return DIV;
return DIVNAME;
*inlr = *on;

I am only really interested in the values being returned. (This is replacing 3 lines of *ENTRY/PLIST code. There is no new functionality here.)

On 6/22/2013 7:14 AM, Vernon Hamberg wrote:
hi Booth

When you pass parameters, it can be no different than it always has
been - a change in the called program is seen in the caller, as you expect.

Things CAN be different if you declare parameters by VALUE or even
CONST. You probably should not be using either of these if modifying
existing stuff to replace *ENTRY PLIST.

That's not really what I think of when you say "return" - that would be
a return value and is specified on the PR/PI line. Only procedures can
return something, not programs - same as always.

If you're changing an existing program, be sure the variable and
parameter names are right, that you are actually putting a value into
both parameters.

Also, be sure lengths and types are the same.

Maybe you can show us your prototype.

HTH
Vern

On 6/22/2013 12:57 AM, Booth Martin wrote:
So I am learning more about prototypes and procedure interfaces and
replacing *ENTRY/PLIST. This is more confusing then I expected.

Here is the scenario:
I have PROGA which has 2 fields to populate; ID# & description.
I have PROGB which displays a subfile of the ID#s and descriptions.
PROGA has a line of code: PROGB(ID#: DESC);

Everything appears to me to be working as desired except that I can not
get the two field's values returned.
It appears to me that I can only return one value. That can't be
right. I must be taking a wrong turn somewhere.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.