个人代码风格注释(变量名中第一个小写字母表表示变量类型)
i:为Integer型;
s:为String;
Function UUTF(Byval a_iNum)
Dim sResultsUTF
Dim iTempiHexNumi
iHexNum = Trim(a_iNum)
If iHexNum = “” Then
Exit Function
End If
sResult = “”
If (iHexNum < ) Then
sResult = sResult & iHexNum
ElseIf (iHexNum < ) Then
sResult = ChrB(&H + (iHexNum And &HF))
iHexNum = iHexNum &H
sResult = ChrB(&HC + (iHexNum And &HF)) & sResult
ElseIf (iHexNum < ) Then
sResult = ChrB(&H + (iHexNum And &HF))
iHexNum = iHexNum &H
sResult = ChrB(&H + (iHexNum And &HF)) & sResult
iHexNum = iHexNum &H
sResult = ChrB(&HE + (iHexNum And &HF)) & sResult
End If
UUTF = sResult
End Function
Function GBUTF(Byval a_sStr)
Dim sGBsResultsTemp
Dim iLeniUnicodeiTempi
sGB = Trim(a_sStr)
iLen = Len(sGB)
For i = To iLen
sTemp = Mid(sGBi)
iTemp = Asc(sTemp)
If (iTemp> OR iTemp<) Then
iUnicode = AscW(sTemp)
If iUnicode< Then
iUnicode = iUnicode +
End If
Else
iUnicode = iTemp
End If
sResult = sResult & UUTF(iUnicode)
Next
GBUTF = sResult
End Function
调用方法
ResponseBinaryWrite(GBUTF(“中国人”))