function CutStr(txt,length) dim x if(isnull(txt)) then CutStr="" exit function end if
txt=trim(txt) x = len(txt)
if(Cint(length)>x) then CutStr=txt else if(asc(mid(txt,length-1,1)) < 0 or asc(mid(txt,length-1,1)) >255) then '如果是汉字 CutStr =left(txt,length+1)&"..." else CutStr =left(txt,length)&"..." end if end if end function
function CutStr(txt,length)
dim x
if(isnull(txt)) then
CutStr=""
exit function
end if
txt=trim(txt)
x = len(txt)
if(Cint(length)>x) then
CutStr=txt
else
if(asc(mid(txt,length-1,1)) < 0 or asc(mid(txt,length-1,1)) >255) then '如果是汉字
CutStr =left(txt,length+1)&"..."
else
CutStr =left(txt,length)&"..."
end if
end if
end function