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



Albert,

The most expensive thing in your code example is the %len(%trimr). So if that's required (in your mysterious alternate universe where it's necessary to blank the field first) then the %subst method will be slower.

But, if the length is already known (and thus the %len(%trimr()) is unnecessary) then the %subst method will be faster, because it has to write fewer blanks to memory. With a mere 2000 bytes of data, the difference will be negligible, but if you ever need to support long strings, you'll start to notice the performance difference.

Switching to VARYING strings would be the best performer.

-SK


On 5/21/2012 2:09 PM, Albert York wrote:

Which is better:

workfield = *blanks

len = %len(%trimr(Newdata));
%substr(workfield:1:len) = *blanks;


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.