Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bintoc() & ctobin()
Message
De
14/05/2005 21:58:22
 
 
À
14/05/2005 14:54:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01014168
Message ID:
01014303
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform