|
M
Answering my own question:
If a parameter is defined as:
D msgDta 32767 CONST OPTIONS(*VARSIZE)
and *BLANK is passed then RPG IV will pass 32767 bytes of blanks.
So that means using *BLANK on OPTIONS(*VARSIZE) parameters for a prototyped
external call is a bad idea because you will force the compiler to create a 32K
temporary variable and fill it with blanks. Using '' or a named constant also
appear to cause 32K to be passed on an external program call. This seems to
defeat part of the point of *VARSIZE. Comments?
Using OPTIONS(*VARSIZE) on a protyped procedure call is acceptable because the
compiler then passes only the actual amount specified.
The compiler behaves differently if a CALL/PARM construct is used because
variables must be used on the PARM statement so only the amount of the variable
is passed. (And, yes, I know parms are passed by reference so the length
really
doesn't enter into it.)
I'm sticking with *OMIT :)
Regards,
Simon Coulter.
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software AS/400 Technical Specialists «»
«» Eclipse the competition - run your business on an IBM AS/400. «»
«» «»
«» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ «»
«» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / «»
«» X «»
«» ASCII Ribbon campaign against HTML E-Mail / \ «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.