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



ed_doxtator=6uS3uco/Pu3QT0dZR+AlfA@public.gmane.org wrote:
>
> Hey all
>
> Something interesting happened to me today.  I was trying to get a better
> handle on Data Structures and parameters in ILE RPG, and I've cause the
> compiler to abend in the most deeelightful way.  Here's the code:
>

Doc, this is the problem of APAR SE06991 (LIKEDS parameter/retval when
there's an array in the DS), but it's not fixed in the V5R2
TGTRLS(V5R1M0) compiler yet.  (I don't know when that PTF is scheduled
to be built.)

By the way, the compiler is also failing to diagnose some incorrect
code.  You should remove the 10a from this line:
   dfunc             pr            10a   likeds(dsFuncPr_t)

As far as a better way of doing that, there is.  There's no particular
advantage of having the structure returned, since you still need to use
additional statements to get the structure values.  But there is a
-dis-advantage to returning structures in general: performance.
Returning "large" values requires additional copies of the data that are
not required when the data is returned through a parameter passed by
reference.

So, better to pass the parameter by reference:

dfunc             pr
d  outStruct                          likeds(dsFuncPr_t)

To call it, instead of coding
            someStruct = func();
you would code
            func(someStruct);

(But this will not solve the problem with the compiler, since it affects
parameters and return values.)




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.