|
Yes, in most case, those parms are not passed. If they are passed in, they will probably be only 10 characters long. As indicated in the previous email that these parms will then pass to another procedure and they are required parms in this procedure. Below is what I end up doing (ok, go ahead and tell me I'm wasting my time): p example B export d pi 10i 0 opdesc d piParm1 32767 const d options(*varsize:*nopass:*omit) d piParm2 32767 const d options(*varsize:*nopass:*omit) d myParm1 s like(piParm1) d based(myParm1_p) d myParm1Len s 10i 0 /free if (%parms >= 1 and %Addr(piParm1) <> *Null); CEEDOD(1 :myOD.dscTyp :myOD.DataTyp :myOD.dscInf1 :myOD.dscInf2 :myParm1Len :*omit); myParm1_p = %alloc(myParm1Len); myParm1 = %subst(piParm1 :1 :myParm1Len); else; myParm1_p = %alloc(1); %subst(myParm1 :1 :1) = ' '; myParm1Len = 1; endif; . . . . -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Peter Levy Sent: Wednesday, August 30, 2006 9:44 AM To: RPG programming on the AS400 / iSeries Subject: Re: Allocate field with options(*nopass :*omit) Yes, copying 32,767 is a lot to copy, but given your "const" keyword there's nothing more you can do. You can use an %addr(piParm1) in an IF expression but not in an EVAL. Given the *varsize option I have to ask: Are you always passing that much data to your procecdure? I would think that most of the time you would be passing much smaller values.
As an Amazon Associate we earn from qualifying purchases.
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.