关于VB一段代码的问题
Private Sub Command1_Click()
Dim strArr() As String, strSubLine() As String, strLine() As String
Dim i As Long, j As Long, k As Long, p As Long, n As Long
Dim isChinese As Boolean
Dim strSource As String
strSource = "我经常逛CSDN论坛,这里有很多experiened man。"
ReDim strArr(Len(strSource) - 1)
strLine = Split(strSource, "?£")
For i = 0 To UBound(strLine)
strSubLine = Split(strLine(i), "£?")
For j = 0 To UBound(strSubLine)
p = 1
For k = 1 To Len(strSubLine(j))
If k = 1 Then
isChinese = (Asc(Mid(strSubLine(j), 1, 1)) < 0)
Else
If (Asc(Mid(strSubLine(j), k, 1)) > 0 And isChinese) Or (Asc(Mid(strSubLine(j), k, 1)) < 0 And Not isChinese) Then
isChinese = Not isChinese
strArr(n) = Mid(strSubLine(j), p, k - p)
n = n + 1
p = k
End If
End If
Next k
strArr(n) = Mid(strSubLine(j), p, k - p)
n = n + 1
Next j
Next i
ReDim Preserve strArr(n - 1)
For i = 0 To n - 1
Debug.Print strArr(i)
Next i
End Sub
这个是咱们CSDN以为好心的大神给我的代码,现在我有个问题哎。"?£" "£?"这两个表达的是什么意思啊?而且我的电脑上也打不出来。出来就是“?£”“£?”.小白一个求好心人指导一下! VB
[解决办法]
本帖最后由 bcrun 于 2013-06-13 15:30:07 编辑
Dim iBuf() As Byte
Dim bytesTotal As Long
Dim i As Long
Dim lnx As String
Dim L As Long
ReDim iBuf(bytesTotal - 1)
'Debug.Print每个收到的字节
i = 0
lnx = "BYTE:" + Right("0000000" + Hex(i), 8) + "-"
For i = 0 To bytesTotal - 1
lnx = lnx + " " + Right("0" + Hex(iBuf(i)), 2)
If i Mod 16 = 15 Then
Debug.Print lnx
lnx = "BYTE:" + Right("0000000" + Hex(i + 1), 8) + "-"
End If
Next
i = bytesTotal - 1
If i Mod 16 <> 15 Then
Debug.Print lnx
End If