欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

GetPaing 函数之asp采集函数中用到的获取分页的代码

程序员文章站 2022-05-03 13:05:32
'================================================== '函数名:getpaing '作  用:获取分页...
'==================================================
'函数名:getpaing
'作  用:获取分页
'==================================================
function getpaing(byval constr,startstr,overstr,inclul,inclur)
if constr="$false$" or constr="" or startstr="" or overstr="" or isnull(constr)=true or isnull(startstr)=true or isnull(overstr)=true then
   getpaing="$false$"
   exit function
end if

dim start,over,contemp,tempstr
tempstr=lcase(constr)
startstr=lcase(startstr)
overstr=lcase(overstr)
over=instr(1,tempstr,overstr)
if over<=0 then
   getpaing="$false$"
   exit function
else
   if inclur=true then
      over=over+len(overstr)
   end if
end if
tempstr=mid(tempstr,1,over)
start=instrrev(tempstr,startstr)
if inclul=false then
   start=start+len(startstr)
end if

if start<=0 or start>=over then
   getpaing="$false$"
   exit function
end if
contemp=mid(constr,start,over-start)

contemp=trim(contemp)
contemp=replace(contemp," ","")
contemp=replace(contemp,",","")
contemp=replace(contemp,"'","")
contemp=replace(contemp,"""","")
contemp=replace(contemp,">","")
contemp=replace(contemp,"<","")
contemp=replace(contemp," ","")
getpaing=contemp
end function