注册 登录
编程论坛 ASP技术论坛

strTemp中的循环问题

dou521 发布于 2010-03-04 10:48, 489 次点击
循环错误,请高手指点

sub ArticleContent(intTitleLen)
    dim i,strTemp
           i=1
              strTemp=""  
              strTemp= strTemp & "<table width=100% border=0 cellspacing=0 cellpadding=0>"
              strTemp= strTemp & "<tr>"
    do while not rsArticle.eof
    strTemp= strTemp & "<td>"
              strTemp= strTemp & "<a href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">"
    fileExt=lcase(getFileExtName(rsArticle("DefaultPicUrl")))
    strTemp= strTemp & "</td></tr>"
              strTemp= strTemp & "<tr><td><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & "</a>"
               strTemp= strTemp & "</td>"
                    if i mod 5= 0 then
          strTemp= strTemp & "</tr>"
          end if
                    rsArticle.movenext
                    i=i+1
                    strTemp= strTemp & "</table>"
  response.write strTemp
  if i>=15 then exit do
loop
end sub
4 回复
#2
aspic2010-03-04 11:26
请勿重复发帖
#3
dou5212010-03-04 12:31
帮我解决下呀
#4
aspic2010-03-04 17:44
简化--》看运行后的html--》找到问题所在--》解决之
#5
yms1232010-03-04 22:10
sub ArticleContent(intTitleLen)
    dim i,strTemp
    i=1
    strTemp=""  
    strTemp= strTemp & "<table width=100% border=0 cellspacing=0 cellpadding=0>"
    strTemp= strTemp & "<tr>"
    do while not rsArticle.eof
       strTemp= strTemp & "<td>"
       strTemp= strTemp & "<a href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">"
       fileExt=lcase(getFileExtName(rsArticle("DefaultPicUrl")))
       strTemp= strTemp & "</td></tr>"
       strTemp= strTemp & "<tr><td><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & "</a>"
       strTemp= strTemp & "</td>"
       if i mod 5= 0 then
          strTemp= strTemp & "</tr>"
       end if
       rsArticle.movenext
       i=i+1
       strTemp= strTemp & "</table>"
       response.write strTemp
       if i>=15 then exit do
    loop
end sub
i>=15这是做什么用呢?
1