by K. Mehdi (1 Submission)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating:
(5 Votes)
A function for converting decimal numbers to binary. Very fast.
Inputs
Decimal number (Long)
Code Returns
Binary number (string)
API Declarations
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