VB PDU mode 7 bit 解码

王朝c#·作者佚名  2006-12-17
窄屏简体版  字體: |||超大  

Dim tep As String

Dim temp As String

Dim i As Integer

Dim B As Integer

Dim rems As String

tep = rmsg

i = Len(tep)

If i < 1 Then Exit Function

B = i / 2

If i = B * 2 Then

tep = Left(tep, B * 2)

Else

B = B - 1

tep = Left(tep, B * 2)

End If

chg7 = ""

rems = ""

Dim trint As Integer

Dim strtmp As String

trint = 1

strtmp = ""

For i = 1 To B

temp = "&H" & Mid(tep, (i - 1) * 2 + 1, 2)

temp = D_To_B(Val(temp)) '转二进制

If Len(temp) < 8 Then

temp = strpla(8 - Len(temp)) + temp

End If

strtmp = Mid(temp, trint + 1, 8 - trint) + rems

rems = Mid(temp, 1, trint)

chg7 = chg7 & ChrW(CInt(Val(B_To_D(strtmp))))

trint = trint + 1

If trint = 8 Then

trint = 1

chg7 = chg7 & ChrW(CInt(Val(B_To_D(rems))))

rems = ""

End If

Next i

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航