Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: VFP literal number and BINTOC
Message
From
25/09/2005 05:48:23
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUG: VFP literal number and BINTOC
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01052820
Message ID:
01052820
Views:
59
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.
Next
Reply
Map
View

Click here to load this message in the networking platform