早教吧 育儿知识 作业答案 考试题库 百科 知识分享

asp代码竖排改为横排,一排4个subShowArticle(TitleLen)ifTitleLen200thenTitleLen=50endififcurrentpagetotalputthenif(totalPutmodMaxPerPage)=0thencurrentpage=totalPut\MaxPerPageelsecurrentpage=totalPut\MaxPerPage+1endifendif

题目详情
asp代码 竖排改为横排,一排4个
sub ShowArticle(TitleLen)
if TitleLen200 then
TitleLen=50
end if
if currentpagetotalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
sqlArticle="select top " & MaxPerPage\x05
else
sqlArticle="select "
end if
sqlArticle=sqlArticle & " ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,Key,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
if BigClassName"" then
sqlArticle=sqlArticle & " and BigClassName='" & BigClassName & "' "
if SmallClassName"" then
sqlArticle=sqlArticle & " and SmallClassName='" & SmallClassName & "' "
end if
else
if SpecialName"" then
sqlArticle=sqlArticle & " and SpecialName='" & SpecialName & "' "
end if
end if
sqlArticle=sqlArticle & " order by articleid desc"
Set rsArticle= Server.CreateObject("ADODB.Recordset")
rsArticle.open sqlArticle,conn,1,1
if rsArticle.bof and rsArticle.eof then
response.Write("
没有任何产品")
else
if currentPage=1 then
call ArticleContent(TitleLen)
else
if (currentPage-1)*MaxPerPage=MaxPerPage then exit do\x05
\x05loop
end sub
▼优质解答
答案和解析
简单的说吧:
i=0
strTemp= strTemp & ""
do while not rsArticle.eof
if i mod 4=0 then
'取余数
strTemp= strTemp & ""
end if
strTemp= strTemp & ""
if i mod 4=3 then
strTemp= strTemp & ""
end if
rs.movenext()
loop
strTemp= strTemp & "
"&rs("xxxxx")&"
"