全角半角转换

Function strConv(strCommix,intState)
Dim strChar
Dim intAsc
Dim strTmp

If intState = 0 Then
For i = 1 To Len(strCommix)
strChar = Mid(str1, i, 1)
intAsc = Asc(strChar)
If (intAsc>=-23648 And intAsc<=-23553) Then
strTmp = strTmp & Chr(intAsc+23680)
Else
strTmp = strTmp & strChar
End if
Next
Else
For i = 1 To Len(strCommix)
strChar = Mid(str1, i, 1)
intAsc = Asc(strChar)
If (intAsc>=32 And intAsc<=127) Then
strTmp = strTmp & Chr(intAsc-23680)
Else
strTmp = strTmp & strChar
End if
Next
End If
strConv = Trim(strTmp)
End Function
posted @ 2008-07-02 17:47  csm  阅读(383)  评论(0)    收藏  举报