| 
 | 
Nelson Smith wrote:
> 
> Does anyone know a way to call a procedure from a CL program that returns an
> indicator (true/false) field?  I've tried *CHAR, *DEC, and *LGL for the
> Return Value parameter, but none of them work.
> 
If the procedure is RPG IV:
- For V5R1+, define the RPG prototype with EXTPROC(*CL:'PROCNAME'). 
Define it as *LGL or *CHAR(1) in the CL.
      D rpgproc       pr        1n    extproc(*CL : 'RPGPROC')
- For prior to V5R1 (or for V5R1+ if you don't want to put *CL on your
EXTPROC), define the return value as 1N or 1A in the RPG, define the
return value in CL as char(2), and use %sst to get the first byte.
 
      dcl &retval2 type(*char) len(2)
      dcl &retval  type(*char) len(1)
 
      callprc rtnval(&retval2)
      chgvar &retval %sst(&retval2 1 1)
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.