Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binary
Message
De
01/03/2006 03:33:52
 
 
À
01/03/2006 02:35:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Binary
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01100270
Message ID:
01100274
Vues:
13
>Hi All,
>
>Is there a quick function to convert a number to binary and back again? i.e.
>
>
>A number like
>739207
>convert to
>10110100011110000111
>convert back to
>739207
>
>
>I have manually programmed this with BITTEST() each bit in the number but was wondering if there is a simpler function / method that I'm not aware of.
>
>Thanks


Jos,

There's nothing simpler I'm aware of

If it's only for occasional use, the bittest() will do fine

You could speed it up by handling half a byte or one byte at a time.
Then you would have an array with the value of the (half) byte + 1 as an index into the array and the value of the element would be '0000', '0001', etc
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform