UBin 感謝網友神行者提供!

從 base2 convert to base10 Private Function UBin(Key)

Dim i As Integer
For i = 1 To Len(Key)
hot$ = Mid(Key, i, 1)
  If hot$ <> "0" Then
    If hot$ <> "1" Then
      Exit Function
    End If
  End If
Next i
For i = 1 To Len(Key)
    UBin = UBin + Val(Mid(Key, i, 1)) * 2 ^ (Len(Key) - i)
Next i
End Function


上一頁