Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binary to/from Decimal
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00418552
Message ID:
00418642
Vues:
31
>One problem with this George. My binary number is 80 (!) characters long. The limit on BITSET is 32. Any other suggestions?
>
>I am basically trying to check for which positions are set to "1" in a string:
>For example, if I am testing for locations 8, 12 and 39, I do:
>
>SELECT *
> FROM x
> WHERE SUBSTRING(lcString,8,1) = "1"
> OR SUBSTRING(lcString,12,1) = "1"
> OR SUBSTRING(lcString,39,1) = "1"
>
>This works but it takes some time. I thought about using BITSET and that's why I was trying to convert to numberic. Any other suggestions?
>
>Thank you.

That's one big number ((2 ^ 80) - 1). Frankly, I don't have any really good ideas here. I did think of storing the value as a 10 character field and converting each 8 bits to a character, but that's about the only idea I've gotten and it might actually make the process harder. Perhaps if you gave some baackground as to the problem and the meaning of the field, someone might have an idea that you could use.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform