Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How we covert a Char,Integer into a Binary
Message
De
24/09/2002 02:48:26
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00703648
Message ID:
00703663
Vues:
14
Thanks a lot.


>>How I covert a Char,Integer into a Binary
>>
>>for example : A = 65 --> 1000001
>
>Try this:
>
>? binary(65)
>
>Function binary(tnVal)
>Local lnMask, lcResult
>lnMask = 1
>lcResult = ''
>Do While lnMask <= tnVal
>	lcResult = IIf(BitAnd(lnMask, tnVal)!=0, '1', '0') + lcResult
>	lnMask = BitLShift(lnMask, 1)
>EndDo
>Return lcResult
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform