Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: VFP literal number and BINTOC
Message
De
25/09/2005 05:48:23
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Titre:
BUG: VFP literal number and BINTOC
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01052820
Message ID:
01052820
Vues:
60
Expected: literal nnnn.dddExxx are read like B(#ddd)

Observed:
VFP moves to the right the decimal point of xxx you positions,
and if the result is a integer the variable as store like a integer.

Result: BINTOC(,"8") can fail,
and we have to compensate the xxx with more decimals zeros.

REPRO:
CLEAR

ON ERROR ?? SPACE(2),MESSAGE()

a= 12E0 && vfp SEE THIS LIKE A INTEGER !
? A,0h+BINTOC(a,"8")

a= 12.0E0 && add a zero for compensation
? A,0h+BINTOC(a,"8")

a= 12.0E1 && vfp SEE THIS LIKE A INTEGER !
? A,0h+BINTOC(a,"8")

a= 12.00E1 && add a zero for compensation
? A,0h+BINTOC(a,"8")

a= 12.00E2 && vfp SEE THIS LIKE A INTEGER !
? A,0h+BINTOC(a,"8")

a= 12.000E2 && add a zero for compensation
? A,0h+BINTOC(a,"8")

a= 12.000E3 && vfp SEE THIS LIKE A INTEGER !
? A,0h+BINTOC(a,"8")

a= 12.0000E3 && add a zero for compensation
? A,0h+BINTOC(a,"8")

a= 12.0E8 && vfp SEE THIS LIKE A INTEGER !
? A,0h+BINTOC(a,"8")

a= 12.0E9 && this cannot to be a integer, then VFP write it in double format
? A,0h+BINTOC(a,"8")
Another effect is as to declare a value with nnn.dddExxx with a decimal format,
this it becomes a complex because:
#decimals=MAX(0,#ddd-xxx)

What mind it can to invent a thing as this.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform