[导入]计算分页的几种方法

<%
    
'计算分页的几种方法
    '来源:http://jorkin.reallydo.com/article.asp?id=426
    
    '// iRecordCount为要计算的页面总数
    '// iRecordCount为记录集数
    '// iPageSize为每页记录数

    '// 一:
    
If iRecordCount Mod iPageSize = 0 Then
        
iPageCount = Int(iRecordCount / iPageSize)
    
Else
        
iPageCount = Int(iRecordCount / iPageSize) + 1
    
End If
    
'// 二:
    
iPageCount = Int(iRecordCount / iPageSize * -1) * -1
    
'// 三:
    
iPageCount = Abs(Int( - (iRecordCount / iPageSize)))
    
'// 四:
    
iPageCount = Fix(iRecordCount / iPageSize) - CInt(CBool(iRecordCount Mod iPageSize))
%>


文章来源:http://Jorkin.Reallydo.Com/default.asp?id=426
posted @ 2008-01-03 11:10  pboy2925  阅读(181)  评论(0)    收藏  举报