GetPaing 函数之asp采集函数中用到的获取分页的代码
程序员文章站
2022-07-01 23:46:07
'================================================== '函数名: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
'函数名: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