Converting Decimal numbers to Binary
A function for converting decimal numbers to binary. Very fast.
Inputs
Decimal number (Long)
Returns
Binary number (string)
API Declarations
Rate Converting Decimal numbers to Binary
(6(6 Vote))
Private Sub Command1_Click()
DecValue = Val(Text1.Text)
BinValue = ""
Do
TempValue = DecValue Mod 2
BinValue = CStr(TempValue) + BinValue
DecValue = DecValue \ 2
Loop Until DecValue = 0
'Print
'Print BinValue
Text2.Text = BinValue
End Sub
Converting Decimal numbers to Binary Comments
No comments yet — be the first to post one!
Post a Comment