18/07/08 22:05
M@d_Hacker
Io uso un codice per convertire i decimali in binario..
Ora te lo posto.. Poi te lo modifiki te..
Ora te lo posto.. Poi te lo modifiki te..
Dim i As Long, x As Long, bin As String Const maxpower = 30 Const maxlenght = 16 bin = "" x = Val(txtdecimale.Text) If x > 2 ^ maxpower Then MsgBox "Il numero non deve essere più grande di", vbCritical & Str$(2 ^ maxpower) iblbinario.Caption = "" Exit Sub End If digit: If x < 0 Then bin = bin + "1" Else bin = bin + "0" For i = maxpower To 0 Step -1 If x And (2 ^ i) Then bin = bin + "1" Else bin = bin + "0" End If Next iblbinario.Caption = bin If txtdecimale.Text = "" Then MsgBox "Inserisci numero", vbCritical End Sub
aaa