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




On Tuesday, November 11, 2003, at 07:43 PM, Werner Noll wrote:


Hi Simon,

sorry for broaching this subject again.

I tried the example you sent me and I'm little bit confused.

When I use your prototype and specify the data parameter with keyword VALUE,
the program gets not compiled. The error message is : "*RNF3754 20 a
000600 A parameter cannot be passed by value to a program."
The only way to get the program compiled with a pointer ist the use of
keyword CONST like in my following example code:


 * Prototype for Send Data Queue (QSNDDTAQ) API
D QSNDDTAQ        PR                  ExtPgm('QSNDDTAQ')
D  p$DtaQ                        10A   Const
D  p$DtaQLib                    10A   Const
D  p$EntryLen                    5P 0 Const
D  p$Data                            *   Const
D  p$KeyLen                      3P 0 Const Options(*NoPass)
D  p$KeyData                 256A   Const Options(*VarSize:*NoPass)
D  p$AsyncRqs                 10A   Const Options(*NoPass)

D Data S 32767A

 /free
  Data = 'ABC';

CallP QSNDDTAQ('TESTQ':'NOLL':%len(Data):%addr(Data));

  Return;
 /end-free

Did I miss something on your example?

You didn't miss anything. I was wrong. What I described will work with procedures but not with programs. This appears to be an RPG IV restriction because the system certainly allows pointers to be passed by value to program objects. Just because most HLL programs don't accept pointers by value is no reason to impose this restriction.


Hans or Barbara: Why is it so?

Werner, note that changing to CONST won't help. The program will compile but it will be passing the address of the pointer which is one level of indirection more than you want. QSNDDTAQ will put crap on the data queue as a result. It looks like the only solution is to send 32K or less prior to 510. Perhaps you could send multiple entries with some sort of continuation flag?

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists

   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.