× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.