convert to binary

March 25, 2009 by admin  
Filed under Visual Basic

Public Function CBin(ByVal Nr As Long, Optional Precision As Integer = 8) As String
Do Until Nr = 0
CBin = CStr((Nr Mod 2)) + CBin
Nr = Nr 2
Loop
CBin = Format(Val(CBin), String(Precision, “0″))
End Function

Private Sub Form_Load()
MsgBox CBin(88)
End Sub

Related posts:

  1. binary to decimal conversions Public Function BinaryToDecimal(Binary As String) As Long Dim n As...
  2. display all processes on your system ‘add a listbox , command button and a textbox ‘User...
  3. Retrieves the path your application is running from. Private Sub Form_Load() MsgBox App.Path End Sub Bookmark It Hide...
  4. Get screen resolution with Visual Basic This Visual Basic example will find out your current screen...
  5. This program gets the absolute path of a file Private Sub Form_Load() Dim objfso As New FileSystemObject Dim strPath...

Related posts brought to you by Yet Another Related Posts Plugin.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!