Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How we covert a Char,Integer into a Binary
Message
From
24/09/2002 02:48:26
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00703648
Message ID:
00703663
Views:
13
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
>
Previous
Reply
Map
View

Click here to load this message in the networking platform