那位高手有空能帮解释下这个程序吗! 不了解呀
End FunctionPrivate Function Hex2(c As String) As String
Hex2 = Hex(c)
If Len(Hex2) < 2 Then
Hex2 = "0" & Hex2
End If
End Function
Private Sub txtTextOut_LostFocus()
Dim c As String
Dim i As Long
Dim Temp As Long
OutputString = ""
If (OutputAscii) Then
For i = 1 To Len(txtTextOut.Text)
c = Mid(txtTextOut.Text, i, 1)
If (c = "\") Then
i = i + 1
c = Mid(txtTextOut.Text, i, 1)
Select Case c
Case "b"
OutputString = OutputString & Chr(8)
Case "t"
OutputString = OutputString & Chr(9)
Case "n"
OutputString = OutputString & Chr(10)
Case "r"
OutputString = OutputString & Chr(13)
Case "\"
OutputString = OutputString & "\"
Case "x"
c = HexChar(Mid(txtTextOut.Text, i + 1, 1)) * 16 _
+ HexChar(Mid(txtTextOut.Text, i + 2, 1))
OutputString = OutputString & Chr(c)
i = i + 2
End Select
Else
OutputString = OutputString & c
End If
Next i
txtTextOut.Text = ""
For i = 1 To Len(OutputString)
c = Mid(OutputString, i, 1)
txtTextOut.Text = txtTextOut.Text & AsciiRep(c)
Next i
Else
i = 1
Do While (Len(Mid(txtTextOut.Text, i)) > 0)
Temp = 0
Do While (Mid(txtTextOut.Text, i, 1)) = " "
i = i + 1
Loop
c = Mid(txtTextOut.Text, i, 1)
Do While Not (c = " " Or c = "")
Temp = (Temp * 16) + HexChar(c)
i = i + 1
c = Mid(txtTextOut.Text, i, 1)
Loop
If (Temp > 255) Then
Temp = 0
End If
OutputString = OutputString & Chr(Temp)
Loop
txtTextOut.Text = ""
For i = 1 To Len(OutputString)
c = Mid(OutputString, i, 1)
txtTextOut.Text = txtTextOut.Text & " " & AsciiRep(c)
Next i
End If
txtTextOut.SelStart = Len(txtTextOut.Text)
End Sub