title image


Smiley Re: Anzeige eines Textes in Binärcode
Hi!



In Text2 steht der Binärcode von Text1:Private Sub Command1_Click()

Dim i As Integer

Text2.Text = ""

For i = 1 To Len(Text1.Text)

Text2.Text = Text2.Text & DecBin(Asc(Right(Left(Text1.Text, i), 1)))

Next i

End Sub





Private Function DecBin(Dezimalzahl As Byte) As String

Dim Temp As String, Summe As Byte, i As Integer

Summe = Dezimalzahl

For i = 8 To 1 Step -1

If Summe - (2 ^ i) >= 0 Then

Temp = Temp & "1"

Summe = Summe - (2 ^ i)

Else

Temp = Temp & "0"

End If

Next i

DecBin = Temp

End Function







MfG

Mr. S ICQ #67858520http://www.developersmanual.com/



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: