当前位置: 移动技术网 > IT编程>开发语言>.net > ASP实例:检测整数和长整数的函数

ASP实例:检测整数和长整数的函数

2019年01月19日  | 移动技术网IT编程  | 我要评论

风雷速递申报类别,情趣内衣9quw,尹先炳

检测整数和长整数的asp函数

<%
检测字符串是否是整数
function is_int(a_str)
    if not isnumeric(a_str) or len(a_str) > 5 then
        is_int = false 
        exit function 
    elseif len(a_str) < 5 then
        is_int = true 
        exit function 
    end if 
    if cint(left(a_str , 4)) > 3276 then
        is_int = false
        exit function
    elseif cint(left(a_str , 4)) = 3276 and cint(right(a_str , 1)) > 7 then
        is_int = false
        exit function
    else
        is_int = true
        exit function
    end if 
end function

检测是否是长整数
function is_lng(a_str)
    if not isnumeric(a_str) or len(a_str) > 10 then
        is_lng = false
        exit function 
    elseif len(a_str) < 10 then
        is_lng = true 
        exit function 
    end if 
    if clng(left(a_str , 9)) > 214748367 then
        is_lng = false
        exit function
    elseif clng(left(a_str , 9)) = 214748367 and clng(right(a_str , 1)) > 7 then
        is_lng = false
        exit function
    else
        is_lng = true
        exit function
    end if 
end function
%>


如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网