看这段asp代码,那位大师帮帮忙?

来源:百度知道 编辑:UC知道 时间:2024/06/01 03:52:19
<%set rs=server.createobject("adodb.recordset")
sql="select top 9 * from SMT_xxnews where SMT_key=1 and SMT_key1=1 and SMT_key2=1 order by SMT_htc desc"
rs.open sql,conn,1,1
m=0
do while not rs.eof
m=m+1
title=trim(rs("SMT_title"))
if cityHTML=1 then
webget="Html/xxnews/"&year(rs("SMT_date"))&month(rs("SMT_date"))&"/"&replace(replace(replace(rs("SMT_date"),"-",""),":","")," ","")&".html"
else
webget="new_view.asp?id="&rs("SMT_id")&""
end if
%>
<tr><td class=list_y valign=middle><p style="line-height:190%">
<img src=img/top<%=m%>.gif align="middle">·<a href=<%=webget%> target="_blank"><%=LeftT(title,20)%></a><br><!-- 标题 -->

<%=LeftT(title,20)%>
应该是<%=Left(title,20)%>吧
意思就是只输出title从左边起前20个字符啊
具体看教程
http://www.56zy.net/Tech.asp

LeftT(title,20)是调用函数取title的前20个字符

就是限定显示title的字数
这里的意思是读取title字段的前20个字符
多出的将不显示

输出title从左边起前20个字符

从左到右读取,标题只显示前20个字符。