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



Bob Cozzi wrote:
> Cool, now we just need to know if %trimL maps to that MI instruction,
> and if it does not, then we can do performance tests to see which one is
> faster.

I'd be interested in seeing performance numbers too.  But notice
that the string parameter to function triml is a null-terminated
string.  Using OPTIONS(*STRING) in RPG will cause the string value
to be moved into a compiler-generated temp for the length of the
string, which itself ain't cheap either.

Also, it would appear that the triml function just takes a single
character as the character to trim.  Using the idiom
"%SUBST(STR:1:%CHECKR('XYZ':STR))" would today allow you to trim any
of a *set* of characters from the end of a string.  (Trimming from
the left end of a string isn't as straight-forward, though, since
you'd have to test for 0 returned from %CHECK() - %SUBST() doesn't
like 0 as a start position.)

As I suggested earlier, perhaps performance could be improved for
some worst case scenarios at the expense of some of the best case
scenarios.  On the whole, given other priorities and alternatives,
I'm not sure if it's really worthwhile.

Cheers!  Hans








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.