AMAZING DECIMAL TOBINARY IN A FEW LINES OF CODE
make a DEC2BIN code easy and quick to run.
Rate AMAZING DECIMAL TOBINARY IN A FEW LINES OF CODE
(3(3 Vote))
Asume that you have a dialog form with a commandbutton, a textbox and a label on it.
Private Sub Command1_Click()
Dim I
Label1.Caption = ""
For I = 7 To 0 Step -1
Label1.Caption = Label1.Caption + Str((Text1.Text And 2 ^ I) / 2 ^ I)
Next I
End Sub
put a number in the textbox, click on the command and the label will show the binary secuence.
it's works. I promise!
it use bit mask to get to the bits on the bytes.
AMAZING DECIMAL TOBINARY IN A FEW LINES OF CODE Comments
No comments yet — be the first to post one!
Post a Comment