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



I made them 10I 0.

It's a label printing application. I'll run out of labels first. <g>

--
Jeff Crosby
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
www.dilgardfoods.com

The opinions expressed are my own and not necessarily the opinion of my
company.  Unless I say so.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On
Behalf Of Rory Hewitt
Sent: Thursday, January 29, 2009 1:59 PM
To: RPG programming on the IBM i / System i
Subject: Re: FOR loop limit

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 is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




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.