Source Code Convert Decimal ke Binary

Rabu, 26 Januari 2011




Source Code Convert Decimal ke Binary adalah tutorial vb program lanjutan dari Convert Decimal ke Binary.
Nih Source Code berikutnya:




Private Sub Command2_Click()
On Error GoTo ErrEnd
For a = 1 To Len(Text2.Text)
If Mid(Text2.Text, a, 1) <> "0" And Mid(Text2.Text, a, 1) <> "1" Then
MsgBox "Wrong binary number!"
Exit Sub
End If
Next a
Dim Binary1 As String
Dim Decimal1 As Long
Decimal1 = 0
Binary1 = Text2.Text
For a = 1 To Len(Binary1)
Decimal1 = Decimal1 * 2 + Mid(Binary1, a, 1)
Next a
Text1.Text = Decimal1
Exit Sub
ErrEnd:
Alert = MsgBox("Error " & Err.Number & ": " & Err.Description, vbCritical)
End Sub
Private Function Deelbaar2(Getal As Long) As Boolean
If Getal = Int(Getal / 2) * 2 Then
Deelbaar2 = True
ElseIf Getal <> Int(Getal / 2) * 2 Then
Deelbaar2 = False
End If
End Function


Silahkan kamu download programnya Sample Convert Decimal ke Binary

Movie Category 1