Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NEVER compare values with EMPTY()!!!! SERIOUS Bug!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00559148
Message ID:
00559860
Vues:
19
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform