Search Tools Links Login

AMAZING DECIMAL TOBINARY IN A FEW LINES OF CODE


make a DEC2BIN code easy and quick to run.

Original Author: QUASI-MODE

Code

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.

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 123 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.