bin2dec.bas

来自「用VISUAL BASIC编制的,一个好用的扫描器」· BAS 代码 · 共 21 行

BAS
21
字号
Attribute VB_Name = "bin2dec"
Public Function Bin(BinaryValue As Variant) As Variant
    Dim Bit As Integer
    Dim Value As Integer
    Dim Counter As Integer


    For Counter = 1 To Len(BinaryValue)
        Bit = Mid(BinaryValue, Counter, 1)
        


        If Bit = 1 Then
            Value = Value + 2 ^ (Len(BinaryValue) - Counter)
        End If
    Next
    Bin = Value
End Function
        

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?