用表单传递值即:<input type="text" name="pagen">
获取即:If cint(request("pagen")) > cint(rs.recordcount/2) Then
pagenow=1
end if
---------------------------
以上语句出现的问题是:当pagen的值过大时会给出“溢出错误”的提示!这个问题该如何解决?
...全文
20417打赏收藏
·溢出错误该如何解决?
用表单传递值即: 获取即:If cint(request("pagen")) > cint(rs.recordcount/2) Then pagenow=1 end if --------------------------- 以上语句出现的问题是:当pagen的值过大时会给出“溢出错误”的提示!这个问题该如何解决?
TRY:
<% private function checknum(a,b)
If IsNumeric(a) And IsNumeric(b) then
If FormatNumber(a,0)>FormatNumber(b,0) then
checknum=1
else
checknum=0
end if
end if
end function %>
来,这个可以:
<% private function checknum(a,b)
If IsNumeric(a) And IsNumeric(b) then
If FormatNumber(a,0)>FormatNumber(b,0) then
If b<=0 then
checknum=0
else
checknum=FormatNumber(b,0)
end if
else If a<1 then
checknum=1
else
checknum=FormatNumber(a,0)
end if
end if
else
checknum=1
end if
end function %>
·这个函数的确可以解决溢出的问题但是,我的目的是pagen不能大于Rcount否则等于Rcount,也不能小于Rcount的下限否则等于Rcount的下限或者等于1!
Function IsNumber(pagen,Rcount)
If IsNumeric(pagen) and IsNumeric(Rcount) Then
If FormatNumber(pagen,0) > FormatNumber(Rcount,0) Then
IsNumber=FormatNumber(Rcount,0)
Else
If FormatNumber(pagen,0) < 0 then ×
IsNumber=1 ×
End if ×
IsNumber=FormatNumber(pagen,0)
End If
End if
End Function
--------------------------------
当我将函数改为此状时标“×”的地方报错:类型不匹配...!
该如何判断FormatNumber(pagen,0)的大小呢?