Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NEVER compare values with EMPTY()!!!! SERIOUS Bug!
Message
De
21/09/2001 04:44:16
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00559148
Message ID:
00559155
Vues:
20
This isnt an empty problem this is a transform bug

There is a KB article on this something to do with FP calculations

>*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() !!!!
Will Jones
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform