Click here to Skip to main content
Licence 
First Posted 23 Jan 2006
Views 26,846
Bookmarked 16 times

Convert Number To Binary

By | 23 Jan 2006 | Article
Convert Number To Binary

Sample Image - Number_To_Binary.jpg

Introduction

Convert Number To Binary

-------------------------

Private Sub Covert_Click()
 Dim mBNumber As Long
 Dim mDNumber As Long
 Dim mKey As Long
 
 If Me.Text1 < 2 Then
  Exit Sub
 End If
 
 mDNumber = Me.Text1
 Me.Label5.Caption = " "

 Do While True
  mBNumber = Int(mDNumber / 2)
  If mDNumber = 2 Then
   mKey = mDNumber - (mBNumber * 2)
   Me.Label5.Caption = "0" & Me.Label5
  Else
   mKey = mDNumber - (mBNumber * 2)
   Me.Label5.Caption = mKey & Me.Label5
  End If
  mDNumber = mBNumber
  If mDNumber = 1 Then
   Me.Label5.Caption = "1" & Me.Label5
   Exit Do
  End If
Loop

End Sub

------------------------------------------------------

Private Sub Text1_Click()
 Me.Label5.Caption = " "
End Sub

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Muhammad Amjad

Web Developer

United Arab Emirates United Arab Emirates

Member

I am science graduate (B.Sc.) having a vast experience in Electronics/Software Technology. I am working as Project Manager in US based company in Karachi.
 
Accomplishments
 
- Designed an extensive client database system of GL, Purchases, Inventories, Production Planning and Sales for Wilson’s Pharmaceuticals, Islamabad
 
- Designed eHR.2003 Human Resources Management system for AMSON VACCINES & PHARMA (PVT) LTD, Islamabad


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralSimpler version PinmemberSteve Holle4:05 11 Sep '07  
GeneralToo Complicated Pinmemberg_p_l0:27 24 Jan '06  
GeneralRe: Too Complicated PinmemberZZRAS1:14 24 Jan '06  
GeneralRe: Too Complicated Pinmemberg_p_l4:21 24 Jan '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 24 Jan 2006
Article Copyright 2006 by Muhammad Amjad
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid