asp限制读出数据文字的长度

来源:百度知道 编辑:UC知道 时间:2024/06/30 02:28:59
我想对读出的片名的文字数限制为5个该怎么加啊?帮我给一下啊?谢谢了
'n_num 调用个数
'c_num 片名字数
'b_num 主演字数
't_num 简介字数
sub video_istop(n_num,c_num,b_num,t_num)
dim types,role,remark
response.write"<table border=0 cellspacing=0 cellpadding=0 style='border-bottom:1px solid #ACE5F0;border-left:1px solid #ACE5F0;border-right:1px solid #ACE5F0'><tr><td width=788 bgcolor='#ACE5F0' height='30'></td></tr></table>"
response.write"<table border=0 cellspacing=0 cellpadding=0 width='790' style='border-bottom:1px solid #ACE5F0;border-left:1px solid #ACE5F0;border-right:1px solid #ACE5F0'>"
i=0
sql="select top "&n_num&" id,pic,name,types,star,counter,emoney,power,role,genre,lang,remark from video where hidden=1 order by tim desc,id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
types=rs("types")

<%
'字符串截取函数,用于信息标题
' strWord需要截取的字符串
' intByteLength显示的字节长度,1个汉字两个字节
' intPadDotAmount背截取后尾部补充点的个数
' 字符串截取函数,用于信息标题
Function FixString(ByVal strWord, ByVal intByteLength, ByVal intPadDotAmount)
If strWord > "" Then
If Length(strWord) <= intByteLength Then
FixString = strWord
Else
Dim i
Dim intLength
Dim strChar
Dim bytChar
intLength = 0
For i = 1 to Len(strWord)
strChar = Mid(strWord, i, 1)
bytChar = Asc(Mid(strWord, i, 1))
If bytChar < 0 or bytChar > 255 Then
intLength = intLength +