Topic Options
#18163 - 08/11/05 10:08 AM Lesson 4 - Bug
John Price Offline
OL Expert

Registered: 10/07/03
Posts: 164
Loc: Wigan, UK
I think lesson 4 has a bug in it. This is the lesson that helps build up a statement.

The code for the run page works fine but will generate a "blank" final page if the number of items in a statement are an exact multiple of 60.

THe maximum number of pages is specified as 33 but if the number of items is at the maximum it will generate 34 pages.

#18164 - 08/11/05 03:31 PM Re: Lesson 4 - Bug

Hello John , you are right .

This is due to the imprecision factor of integer division.

Replace the 3rd line of code by this one to solve your problem.

define(&TotalPages,integer,floattoint((inttoFloat(&NumLineItems) / 60.0000) + 0.4) )