|
If you want to use the fndinxen procedure to read from a user index you need a system pointer that is set to the user index. For that you use the rslvsp2 procedure call. ** ---------------- miFndinxen --------------------------- dmiFndinxen pr extproc('_FNDINXEN') d pInBuf * value d spInIdx * const procptr d pOptions * value d pArgs * value ** -------------------- miRslvsp2 ------------------------- dmiRslvsp2 pr extproc('_RSLVSP2') d pOutSysPtr * procptr d InObj const likeds(miObject) These two prototypes work whether the system pointer parameter is declared as a procptr or a regular pointer. But that is only because the system pointer is passed by reference. In RPG, when you assign one pointer to another: d ptr1 s * d ptr2 s * ptr1 = ptr2 ; the assignment works, even if the pointer is a system pointer. But when a pointer that contains a system pointer is passed by value to a procedure, the pointer arrives in the called procedure as *null. not good. When the pointer is declared as a PROCPTR a system pointer passed by value to such a parm arrives ok. It does not lose its system pointer value. I would like to know if system pointers and procedure pointers are the same thing. Or will code that relies on a procedure to correctly return a system pointer possibly not work in a future release? thanks, -Steve
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.