The Problem still is there.
The empty() Command delivers a false while the Value itself can be compared with 0.
The empty() command obviously has a bug.
Here's the Code again.
clear
local a, b, c, d,x
a= -1
b= -0.1
c= 1
d= 0.1
x= a+b+c+d
? empty(x)
? x=0 &&This should also deliver a ".f." but it gives us a .t.
I think Microsoft should repair this. I understand the floating point, but I never suspected it in any command from FoxPro.
Here's a workaround code. But I think we could instanciate every FoxPro command like this one if we can not dely on the behavior. Also this slows down our programs a little bit.
*proc_empty.prg
lparameters lvValue
if type("lvValue")="N"
return lvValue=0
else
return empty(lvValue)
endif
Marvin Blase (tA-logistic Software GmbH)
You'll never notice the good things if you haven't seen the bad.