发表于:2015/12/2 13:32:07
#0楼
请高人解释一下下面这段VB程序每句的意思,谢谢!
aa = DAT(j - 105)
bb = DAT(j - 104)
cc = DAT(j - 103)
dd = DAT(j - 102)
f = Hex(aa * 255)
If Len(f) = 3 Then
f = "0" + f
End If
g = Hex((bb - 1) * 255)
If Len(g) = 3 Then
g = "0" + g
End If
h = Hex((cc - 2) * 255)
If Len(h) = 3 Then
h = "0" + h
End If
i = Hex((dd - 3) * 255)
If Len(i) = 3 Then
i = "0" + i
End If
pro(0) = Val("&H" + Mid(f, 3, 2))
pro(1) = Val("&H" + Mid(g, 3, 2))
pro(2) = Val("&H" + Mid(h, 3, 2))
pro(3) = Val("&H" + Mid(i, 3, 2))
v = 0
Do While v <= 3
If pro(v) <= 127 Then
Text1.Text = Text1.Text + Chr(pro(v))
v = v + 1
Else
Text1.Text = Text1.Text + Chr(Val("&H" + Hex(pro(v)) + Hex(pro(v + 1))))
v = v + 2
End If
Loop
End If
aa = DAT(j - 105)
bb = DAT(j - 104)
cc = DAT(j - 103)
dd = DAT(j - 102)
f = Hex(aa * 255)
If Len(f) = 3 Then
f = "0" + f
End If
g = Hex((bb - 1) * 255)
If Len(g) = 3 Then
g = "0" + g
End If
h = Hex((cc - 2) * 255)
If Len(h) = 3 Then
h = "0" + h
End If
i = Hex((dd - 3) * 255)
If Len(i) = 3 Then
i = "0" + i
End If
pro(0) = Val("&H" + Mid(f, 3, 2))
pro(1) = Val("&H" + Mid(g, 3, 2))
pro(2) = Val("&H" + Mid(h, 3, 2))
pro(3) = Val("&H" + Mid(i, 3, 2))
v = 0
Do While v <= 3
If pro(v) <= 127 Then
Text1.Text = Text1.Text + Chr(pro(v))
v = v + 1
Else
Text1.Text = Text1.Text + Chr(Val("&H" + Hex(pro(v)) + Hex(pro(v + 1))))
v = v + 2
End If
Loop
End If
摸着石头过河,走自己的路吧!