Function gotTopic(str,strlen)
'函数名称: gotTopic
'功能描述: 控制字符串显示的长度
'使用方法:gotTopic(str,strlen)
Dim l,t,c
l=len(str)
t=0
If IsNull(str) Then Exit Function
For i=1 to l
c=Abs(Asc(Mid(str,i,1)))
If c>255 Then
t=t+2
Else
t=t+1
End if
If t >= strlen Then
gotTopic=left(str,i)&"..."
exit for
Else
gotTopic=str&""
End if
Next
End function
转载于:https://www.cnblogs.com/houbusheng123/archive/2010/07/30/1788698.html