这是一个采集页面中的一段原码,请问下是什么意思????

来源:百度知道 编辑:UC知道 时间:2024/06/30 15:16:32
length=instr(mytext,"<a href")-11
if length>0 then mytext=left(mytext,length)
if left(mytext,1)="<" then mytext=mid(mytext,4)
if trim(title)<>"" and isnumeric(id) then
Response.write id+ " "+title+" "+refulsh(id,title,mytext)+"<br>"
end if
什么意思!有谁能跟我说说详细的意思吗 谢谢了

length=instr(mytext,"<a href")-11
'取mytext中第一次出现"<a href"字符的位置
if length>0 then mytext=left(mytext,length)
'如果出现了"<a href",那length就>0,去mytext中"<a href"字符之前的内容
if left(mytext,1)="<" then mytext=mid(mytext,4)
'如果mytext的开头字符为"<" 从mytext中返回第4个字符开始的内容
if trim(title)<>"" and isnumeric(id) then
'如果title和id不为空
Response.write id+ " "+title+" "+refulsh(id,title,mytext)+"<br>"
'html的显示内容+refulsh函数给出的三个值
end if

length=instr(mytext,"<a href")-11 求mytext中包含"<a href"字符的位置,如果不包含length=-1。
if length>0 then mytext=left(mytext,length) 从mytext左边取出length个字符。
if left(mytext,1)="<" then mytext=mid(mytext,4) 取出mytext左边第4个字符开始的所有字符。
if trim(title)<>"" and isnumeric(id) then 判断title不是空格,id是数字则执行下面一句
Response.write id+