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



Hi Roger,

But they are listed as exported procedures in QC2UTIL2 *SRVPGM.


Thanks for that response.. I didn't think to look for the exports directly. It's interesting, because I can't find any reference to these exports in QSYSINC/H. Perhaps they are for backward compatibility?

Anyway, you're right, they do exist, and I rolled up a quick RPG program to test the isprint() function and it worked nicely for me. Here's the code I tested with:

H DFTACTGRP(*NO) ACTGRP('KLEMENT') BNDDIR('QC2LE')

D isprint PR 10i 0 extproc(*CWIDEN: 'isprint')
D char 1a value

C *ENTRY PLIST
C parm char 1
/free
if isprint(char) = 0;
dsply 'non-print';
else;
dsply 'printable';
endif;
return;
/end-free

Here are a few key points to understand:

a) C widening (the *CWIDEN bit) should promote the 1A passed by VALUE to a 10i 0. I use this so I can pass a 1A as input which is more natural in RPG.

b) True/False in C is based on whether an integer is 0 (false) not non-zero (true). So to check whether it's printable, you need to compare against the output being 0 or not zero.

Good luck



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.