Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bintoc() & ctobin()
Message
From
14/05/2005 21:58:22
 
 
To
14/05/2005 14:54:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01014168
Message ID:
01014303
Views:
20
Hilmar:

"Necessity" the mother of invention. I took a different approach and used ASC() to convert a string to a number that I could then manipulate with BITCLEAR(), BITSET() and so forth. I then used CHR() to convert back to a string. Before I had been using CTOBIN() and BINTOC() to do the conversions. The problem with VFP8 and below is that BINTOC() sets the sign which corrupts the bit map I was building. VFP9 has the "S" parameter to prevent this. How-some-ever, I ran into some compatibility problems with VFP9 (that's another story) and had to rule that path out. Using ASC() and CHR() are a little awkward because I have to work with 8 bits at a time and the bit maps are usually 64 or 128 bits. Not a big deal really. Once I finish coding the functions I probably won't see them again for three or four years.

None the less, I needed to do this post because I was staring at a blank wall.

Thanks,

Scott
Scott Ramey
BDS Software
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform