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



THarteau@xxxxxxxxxxxxxxxxxx wrote:

Hi,
      I am just starting to write external procedures and service programs.
I am trying to use a data structure as a parameter, but keep getting
errors. I am using an example from Club Tech as a guide. Can someone tell
me what I am doing wrong?

In a /COPY member I have
0009.00   // ---------------------------------------------Prototype:
DescClass
0010.00 D DescClass       PR              N
0011.00 D                                             LikeDS(ItemInfo)
0012.00
0013.00 D ItemInfo        DS                  Based(ItemInfoPtr)
0014.00 D  ItemIn                        15
0015.00 D  DscOut                     30
0016.00 D  ClsOut                         2

Then in my module, I have
PDescClass        B                   EXPORT
D DescClass       PI              N
D  ItemInfoDS                            LikeDS(ItemInfo)
D*
 *RNF3766 30     70 001100  Too many parameters specified in the procedure
interface;
                            extra parameters ignored.
& also this error
 *RNF3761 20     69 001000  Type (N(1)) of return-value not same as
prototype (DS(47)DIM)
Where line 69 is the PI line


Change your prototype to this:


-------------------------------------------------------
D DescClass       PR              N
D   ItemInfoDS                        LikeDS(ItemInfo)
-------------------------------------------------------

That is, give a name to the parameter in the prototype. Otherwise, RPG thinks the LIKEDS keyword applies to DescClass, thus the 3761 message.

Cheers! Hans



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.