Alan,

Certainly it's a better idea to use an integer in terms of performance and
the the OP wouldn't have hit *this* problem (overflowing at 1000), but if
he'd specified, for instance, a 3I field, he'd have hit a problem at 128,
since a 3I field can only store up to 127. Or at 32768 for a 5I field.

The underlying problem is that the FOR loop checks for 'greater-than-limit'
rather than 'equal-to-limit' - in other words, your index has to be able to
take a value 1 greater than the limit.

Rory
On Thu, Jan 29, 2009 at 10:37 AM, Alan Campin <alan0307d@xxxxxxxxx> wrote:

The solution is simple. Don't use packed decimal for loop index. Many,
many times slower. Always, always use integers. The compiler is
working correctly.

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