|
The subprocedure's prototype: D MyGetVar pr opdesc D varname 50 const varying options(*varsize) D varvalue 32767 options(*varsize) D occurrence 10i 0 const options(*nopass)
The subprocedure's implementation P MyGetVar b D MyGetVar pi opdesc D varname 50 const varying options(*varsize) D varvalue 32767 options(*varsize) D occurrence 10i 0 const options(*nopass)
* Work fields D wk s 32767 varying D i s 10i 0
* Parameters for CEEDOD, get operational descriptors (CEEDOD is prototyped * in QRPGLESRC member PROTOTYPEB) D Parmnum s 10i 0 D DescType s 10i 0 D DataType s 10i 0 D DescInfo1 s 10i 0 D DescInfo2 s 10i 0 D InDataSize s 10i 0
* Set i to occurrence C if %parms < 3 C eval i = 1 C else C eval i = occurrence C endif * Get information about second parameter. Will use InDataSize C callp ceedod(2:DescType:DataType:DescInfo1: C DescInfo2:InDataSize:*omit) * Get value and assign to varvalue, but only for varvalue's actual length C eval wk = ZhbGetVar(varname:i) C eval %subst(varvalue:1:InDataSize) = wk P MyGetVar e
Sample uses: C callp mygetvar('custname':custname) C callp mygetvar('somevar':somevar:someoccur)
Mel Rothman, CGIDEV2 Author Mel Rothman, Inc.
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.