Range = Range + StepRange
Loop
if tmpI = Cint(CurrentPage) then
intStart = Truncate(1,tmpI)
intLen = Truncate(2,tmpI)
end if
next
if Cint(CurrentPage) = getTotalPageCount() then
response.write(mid(PagingString,intStart)) '如果当前分页为最后一页,则取剩下的所有字符
else
response.write(mid(PagingString,intStart,intLen))
end if
End Sub
End Class
调用示例
set paging=new autopaging
with paging
.pagingstring=Content
.pagingsize=WordLength
.splitchar=array("br>","BR>","Br>","bR>","p>","P>")
end with
TotalPage = paging.gettotalpagecount()
Page=request("page")
if Page="" or Cint(Page)1 then
Page=1
else
if Cint(Page) > TotalPage then
Page = TotalPage
else
if CheckValid(Page)=false or not isnumeric(Page) then
response.write("页码参数非法,请返回!")
response.end
end if
end if
end if
paging.currentpage=Page
paging.outputstring
set paging=nothing
分页页码部分:
if TotalPage > 1 then
For i=1 to TotalPage
if i = Cint(Page) then
response.write("b>" & i &"/b>")
else
response.write("a href=readnews.asp?newsid=" & NewsID &"&bigclassid=" & BigClassID &"&smallclassid=" & SmallClassid &"&specialid=" & SpecialID &"&page=" & i &"> [" & i &"]/a>")
end if
Next
end if