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
Titre:
NEVER compare values with EMPTY()!!!! SERIOUS Bug!
Divers
Thread ID:
00559148
Message ID:
00559148
Vues:
51
*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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform