Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUGs: bintoc/ctobin issues with B,8,S flags
Message
From
25/09/2005 06:25:01
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUGs: bintoc/ctobin issues with B,8,S flags
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01052821
Message ID:
01052821
Views:
94
Observed:
the definition of "B" and "8" they are wrong.
- BINTOC ignore "S"
- BINTOC "8RS" apply S before R and this change the sign of the value
- CTOBIN "B" and "8" are swapped respect to BINTOC

REPRO
CLEAR

a= 12.0

* ISSUE
? [BINTOC(a,"BRS") =],0h+BINTOC(a,"BRS") AT 40
* WANT : 0h+BINTOC(a,"BR") && not revert and xor bit
? [BINTOC(a,"BR")  =],0h+BINTOC(a,"BR") AT 40,[   bad, this is BINTOC(a,"BRS")]
* WORKAROUND
? [for BINTOC(a,"BR") use BINTOC(a,"8")]	,0h+BINTOC(a,"8") AT 40

?
? [BUG: bintoc/ctobin "8","B" with same flag is not invariant]
? [expected 12  ],CTOBIN(BINTOC(a,"B")	,"B")
? [expected 12  ],CTOBIN(BINTOC(a,"BR")	,"BR")
? [expected 12  ],CTOBIN(BINTOC(a,"BS")	,"BS")
? [expected 12  ],CTOBIN(BINTOC(a,"BRS"),"BRS")
? [expected 12  ],CTOBIN(BINTOC(a,"8")	,"8")
? [expected 12  ],CTOBIN(BINTOC(a,"8R")	,"8R")
? [expected 12  ],CTOBIN(BINTOC(a,"8S")	,"8S")
? [expected 12  ],CTOBIN(BINTOC(a,"8RS"),"8RS")

?
? "WANT YOU A CONVERSION ?"
? "WORKAROUND"
? [YOU CAN BUT YOU HAVE TO CONVERT WITH "B" AND RECONVERT WITH "8"]
? [expected 12  ],CTOBIN(BINTOC(a,"B")	,"8")
? [expected 12  ],CTOBIN(BINTOC(a,"BR")	,"8R")
? [expected 12  ],CTOBIN(BINTOC(a,"BS")	,"8S")
? [expected 12  ],CTOBIN(BINTOC(a,"BRS"),"8RS")
? [expected 12  ],CTOBIN(BINTOC(a,"8")	,"B")
? [expected 12  ],CTOBIN(BINTOC(a,"8R")	,"BR")
?
? [ANOTHER BUG: BINTOC("8") APPLY BEFORE "S" AND AFTER "R"]
? [this change the sign of the number]
? [expected 12  ],CTOBIN(BINTOC(a,"8S")	,"BS")
? [expected 12  ],CTOBIN(BINTOC(a,"8RS"),"BRS")

? "WORKAROUND"
? "then you have to invert the sign in this case"
? [expected 12  ],CTOBIN(BINTOC(a,"8S")	,"B")
? [expected 12  ],CTOBIN(BINTOC(a,"8RS"),"BR")
I understand all the problems of MS and the team,
but who has written the procedure
it could not try at least
? CTOBIN(BINTOC(1.0, "B"), "B")  
and to acknowledge the problem.
Next
Reply
Map
View

Click here to load this message in the networking platform