README.md

December 4, 2022 ยท View on GitHub

Converting Decimal numbers to Binary

Description

A function for converting decimal numbers to binary. Very fast.

More Info

Decimal number (Long)

Binary number (string)

Submitted On
ByK. Mehdi
LevelUnknown
User Rating4.8 (24 globes from 5 users)
CompatibilityVB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryMath/ Dates
WorldVisual Basic
Archive File

Source Code

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