sub show_page(total_records,everypage_records,current_page,url)
if IsNumeric (total_records) then total_records=Int(total_records) else total_records=0 end if
if IsNumeric (everypage_records) then everypage_records=Int(everypage_records) if everypage_records<=0 then everypage_records=10 end if else everypage_records=10 end if
if IsNumeric (current_page) then current_page=Int(current_page) else current_page=1 end if
'取总页数,即最后一页 if total_records mod everypage_records=0 then last_page=Int(total_records/everypage_records) else last_page=Int(total_records/everypage_records)+1 end if
'判断 current_page 是否符合标准,并附值给page if current_page>=last_page then page=last_page elseif current_page<=1 then page=1 else page=current_page end if
'上一页 if page<=0 then prepg=0 else prepg=page-1 end if '下一页 if page=last_page then nextpg=0 else nextpg=page+1