Submitted on: 2/16/2015 6:06:00 PM
By: QUASI-MODE (from psc cd)  
Level: Beginner
User Rating: By 3 Users
Compatibility: VB 3.0, VB 4.0 (32-bit), VB 5.0, VB 6.0, VB Script, ASP (Active Server Pages) , VBA MS Access, VBA MS Excel
Views: 6520
     make a DEC2BIN code easy and quick to run.

				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.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

5/15/2018 4:27:09 PMJJ Banks

Nice try :)
It work and it doesn't work.
The idea is good, but the binary is all wrong... just try to convert your answer from binary to decimal and you'll see.
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.