*Hi FoxPro users!
*We have found a serious Problem with the EMPTY() comparison.
*The Code Sample uses a CURSOR Table, but you dont have to!
*You could also use the values in variables
local lnValue
create cursor Test(value n(10,2))
select test
**Append Values in exactly this Order
append blank
replace value with 260.70
append blank
replace value with -31.60
append blank
replace value with -260.70
append blank
replace value with 31.60
lnValue = 0
select test
scan
lnValue=lnValue+value
endscan
wait window "Empty="+transform(empty(lnValue));
+" ; lnValue="+transform(lnValue);
+" ; Comparison on lnVALUE=0 is "+transform(lnValue=0) && This Value should be Empty()! But it isn't!
*Serious Problem!
*But when you have the Table values in this Order
*260.70
*-260.70
*-31.60
*31.60
*
*or this order
*
*260.70
*31.60
*-31.60
*-260.70
*
*it gives you the correct empty=.t.
*Same Problem with the Order of values
*260.70
*31.60
*-260.70
*-31.60
*This Causes an error which is not displayed in transform
*1
*-0.1
*-1
*0.1
*The difference is in the 37 Comma Digit of the value
*This means for us.... we have to create an ORDER on every VALUE we want to ADD
*
*OR
*
*Never Compare a Value with empty() !!!!
Marvin Blase (tA-logistic Software GmbH)
You'll never notice the good things if you haven't seen the bad.