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



Hello,

Hmm, one of the first problems that comes to mind with the %char bif
is zero. What if you wanted to test for 0 in your list? I think
%char(0) returns a zero length string...

Huh? Why would %CHAR(0) return a zero length string? It'd return a string one character long containing '0'.

Do you need to accommodate negative values? If so, I'd suggest
%editc(chk1 : 'J') and test for values padded with space (positive)
or a "-".

%EDITC doesn't trim blanks, so you'd have to add an additional %TRIM() to your statement. Yuck. Again, what's wrong with %char() here?

if %scan(%char(chk1): '-1|-7|-8|-9') > 0;

I don't see why that wouldn't work?

For the record: I don't like any of these %SCAN kludges. I'd much rather see the normal if/or/and syntax that already exists in RPG. That will perform better _and_ it's easier to read/maintain. But, if you must use an ugly kludge, I'd rather see %CHAR() than %TRIM(%EDITC())

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.