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

Click here to load this message in the networking platform