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



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 04/22/2020
11:51:59 AM:
"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> wrote on 04/22/2020
11:26:46 AM:
But it's usually faster for the computer to keep all its
operations in the machine-native numeric format and use math rather
than converting to and from string. (This is not a hard-and-fast rule;
it depends on the thing you're trying to do.)


So, you're saying that if I wanted to know the number of digits
actually used in a 7-digit packed number (i.e., without the leading
zeroes), I might do it in the following "stringy" way:

dcnt = %len(%trim(%char(%abs(mynumber))));


Otherwise, the following might be the math way:

if dcnt < 10;
dcnt = 1;
else;
dcnt = %int((%abs(mynumber) + 1) / 10);
endif;


Aaaa, my math example is flawed. But, you get what I mean.


Sincerely,

Dave Clark

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.