|
Jean, Why have a CLP in the middle of the call? Just call the second RPGLE programme directly. Or is there a logical explanation for the CLP? Besides that: 1) in the CL you have defined the second parm as DEC, but in the prototype it is CHAR. I assmue the &OKFlag is not a passed parm. In the second programme the second parm is also DEC: a mismatch of data types. 2) You also use an array based on a pointer. Do you allocate memory for the array? 3) The two arrays in the second programme do not have the same length. Regards, Carel Teijgeler. *********** REPLY SEPARATOR *********** On 28-10-03 at 10:10 Jean Reksodiputro wrote: >I'm trying to figure out how to pass an arrray from RPGLE to a CLP (just pass > thru) and to another RPGLE, but I'm stuck now. If the pointer guru, Scott > Klement, or Hans & Barbara can help it would be great. > >Here's the thing: >I have a wrapper CLP, where I declared this vars: > Dcl &ArrWhs *Char 1 > Dcl &NbrWhs *Dec (3 0) 0 > Dcl &OkFlag *Char 1 > >It will call an RPGLE pgm and it will build an array to be passed back. Here's > the prototype: > > *Entry parms Prototype: - Array of Authorized Divisio( >Divspwhchkr PR >D 2 0 dim(99) >D 3 >Divspwhchkr PI >D p1_AuthWhs 2 0 dim(99) >D p1_NbrWhs 3 > >Then the CL will pass that array to be used for another RPGLE program: >d ReleaseEm pr EXTPGM('IVSPRELSER' ) >d 2 0 dim(99) >d 3 0 >d 1 >d ReleaseEm pi >d p1_whsArr 2 0 dim(99) >d p1_numArr 3 0 >d p1_exitType 1 > >In this program I get the Address of the parameter and try to move it to be >used for the program: >d ptr_whsArr s * >d whsArr s 2 0 dim(99) based(ptr_whsArr) >d atWhsArr s 3 0 dim(99) inz(*hival) >d xx s 3 0 inz(0) > >c if p1_numArr > 0 >c if %addr(p1_whsArr) <> *null >c eval ptr_whsArr = %addr(p1_whsArr) > >c for xx = 1 by 1 to p1_numArr >c eval atWhsArr(xx) = whsArr(xx) >c endfor > >c endif >c endif > >But, once I assign the Address of p1_whsArr parameter, I got a corrupted array. > Hence, I got a decimal data error. Can someone tell me where I got it wrong? > Do > I really need to declare the variable in CL as big as %ELEM * %LEN?
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.