Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How we covert a Char,Integer into a Binary
Message
 
À
24/09/2002 00:50:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00703648
Message ID:
00703662
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform