帮忙看看这个涵数是什么意思,急,
Public Function Decode(strin) As String
Dim strtemp As String
Dim strout As String
Dim i As Integer
For i = 1 To Len(strin) Step 3
strtemp = Mid(strin, i, 3)
'strtemp = Format(CLng("&H" & strtemp), "000")
strtemp = StrReverse(strtemp)
strtemp = Format(CLng("&H" & strtemp), "000")
strout = strout & strtemp
Next
For i = 1 To Len(strout) Step 3
strtemp = Mid(strout, i, 3)
strtemp = strtemp - 100
strtemp = Chr(strtemp)
Decode = Decode & strtemp
Next
Decode = UCase(Decode)
End Function
[解决办法]
Public Function Decode(strin) As String
Dim strtemp As String
Dim strout As String
Dim i As Integer
For i = 1 To Len(strin) Step 3
strtemp = Mid(strin, i, 3)
'strtemp = Format(CLng("&H" & strtemp), "000")
strtemp StrReverse(strtemp)
strtemp = Format(CLng("&H" & strtemp), "000") '十六进制数转化为long型,并格式化
strout = strout & strtemp
Next
For i = 1 To Len(strout) Step 3
strtemp = Mid(strout, i, 3)
strtemp = strtemp - 100
strtemp = Chr(strtemp) ‘转换为字符
Decode = Decode & strtemp
Next
Decode = UCase(Decode)
End Function
对输入的字符串参数(十六进制数的字符串),截取每三位,转化成三位的long型,然后将转化后的每三位long型减去100的字符(估计是ascii码)
比如decode("0C50C6")
strtemp = "0C5"
strtemp = 197 '十进制
197-100=97
chr(97)="a"
同理:0C6就是"b"
函数返回"ab”