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

posted on 2010-07-30 14:04  houbusheng123  阅读(180)  评论(0编辑  收藏  举报