' ---------------------------------------------
' 返回字符串的长度:字节数
' ---------------------------------------------
function StringLen( str )
dim nLength, nLoop
nLength=0
StringLen = 0
nLength=len(str)
for nLoop = 1 to nLength
if asc(mid(str,nLoop,1))<0 then
StringLen=int(StringLen) + 2
else
StringLen=int(StringLen) + 1
end if
next
end function
可解决字符串中含有汉字时的长度计算问题