Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Are comparisons not working right in 6?

edited August 2003 in RAP
Hi,

I am in Delphi 5 and RB 6.03 and I have a code that
read:

var
age: integer;
...
age:=mycalc(x);
if age=-1 then
a1:=a1+1
else if (i>-1) and (i<18) then
a2:=a2+1
else if (i>=18) then
a3:=a3+1;
...

This does not have any in a2. Changing the
code to:

var
age: integer;
...
age:=mycalc(x);
if age<0 then <====chnaged
a1:=a1+1
else if (i>=0) and (i<18) then <=========changed
a2:=a2+1
else if (i>=18) then
a3:=a3+1;
...
does count it in a2 correctly

Has this been seen before? Is it fixed in 7?

Thanks,
Joseph Gordon

Comments

  • edited August 2003
    What type is the variable i? If it is a floating point number, then
    comparisons usually fail because of precision differences on the decimal.
    Can you send us a simple example report with RAP code that shows the problem
    to support@digital-metaphors.com and we'll test it.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.