公交车上荫蒂添的好舒服的电影-公用玩物(np双xing总受)-公用小荡货芊芊-公与妇仑乱hd-攻把受做哭边走边肉楼梯play-古装一级淫片a免费播放口

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

asp cint clng的范圍與防止cint和clng的溢出解決方法大全

admin
2013年4月24日 22:22 本文熱度 4660

首先我們需要了解的是


cint范圍 -32,768 到 32,767。
clng范圍 -2,147,483,648 到 2,147,483,647。


cint與clng含義:


都可以強(qiáng)制將一個表達(dá)式轉(zhuǎn)換成數(shù)據(jù)類型


cint與clng處理數(shù)據(jù)的范圍:


CInt Integer -32,768 至 32,767,小數(shù)部分四舍五入。
CLng Long -2,147,483,648 至 2,147,483,647,小數(shù)部分四舍五入。


所謂溢出指的是超出處理數(shù)據(jù)的范圍,下面代碼是處理數(shù)據(jù)防止溢出的代碼,大家可以自己看看:


'檢測是否是短整數(shù)



復(fù)制代碼 代碼如下:
sub Is_Int(string)
if len(abs(string))>10 then response.write "數(shù)據(jù)溢出":response.end
if instr(string,"-")<1 then
if cint(left(string,4))>3276 and cint(right(string,1))>7 then response.write "數(shù)據(jù)溢出":response.end
else
if cint(left(abs(string),4))>3276 and cint(right(string,1))>8 then response.write "數(shù)據(jù)溢出":response.end
end if
end sub



'檢測是否是長整數(shù)
復(fù)制代碼 代碼如下:
sub Is_Lng(string)
if len(abs(string))>10 then response.write "數(shù)據(jù)溢出":response.end
if instr(string,"-")<1 then
if clng(left(string,9))>214748364 and clng(right(string,1))>7 then response.write "數(shù)據(jù)溢出":response.end
else
if clng(left(abs(string),9))>21478364 and clng(right(string,1))>8 then response.write "數(shù)據(jù)溢出":response.end
end if
end sub



以下是一些檢驗函數(shù),需要的朋友可以參考下:


第一種:
一、檢測它是不是整數(shù)
復(fù)制代碼 代碼如下:
function Is_Int(a_str)
if not isnumeric(a_str) or len(str) > 5 then
Is_Int = false
exit function
elseif len(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


 



二、檢測它是不是長整數(shù)


復(fù)制代碼 代碼如下:
function Is_Lng(a_str)
if not isnumeric(a_str) or len(str) > 10 then
Is_Lng = false
exit function
elseif len(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


如果我們只需要是數(shù)子,其它的東西,都可以替換為空,下面這個是一個正則,替換非數(shù)字的正則
復(fù)制代碼 代碼如下:
function replacestr(str)
dim re
set re=new regexp
re.ignorecase=true
re.global=true
re.pattern="\D"
str=re.replace(str,"")
replacestr=str
set re=nothing
end function


下面是上面的調(diào)用方法
復(fù)制代碼 代碼如下:
id=replacestr(id)
if len(id)>5 then id=left(id,5)
if id<>"" then id=clng(id)
if err.number<>0 Or id="0" then response.redirect ""
dim rs
set rs=conn.execute("select id from news where id="&id&"")


該文章在 2013/4/24 22:22:58 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點晴ERP是一款針對中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運作、調(diào)度、堆場、車隊、財務(wù)費用、相關(guān)報表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點,圍繞調(diào)度、堆場作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點晴WMS倉儲管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務(wù)都免費,不限功能、不限時間、不限用戶的免費OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved

主站蜘蛛池模板: 国产精品午夜福利在线一区二区 | 国产午夜不卡av免费 | 国产一区日韩二区欧美三区 | 国精品午夜福利视频不卡麻豆 | 国产成人18黄网站在线观看 | 国产高清美女一级a毛片久久w | 国产精品嫩草影院一二三区入口 | 精品视频免费在线 | 成人国产精品一区在线观看播放 | 国产成人av激情在线播放 | 国产精品无码免费视频二 | 国产欧美另类精品久久久 | 顶级欧美色妇xxxxx | 国产毛片特级av片 | 国产后式视频无码在线 | 国产成人久久一区二区不卡三区 | 国产精品国内自产拍在线播放 | av中文字幕精品一区二区久久久 | 国产成人精品福利网 | 3p国产对白刺激在线视频 | 精品国产av一二三四区 | 国产大学生无套内射 | 国产成人啪精品视频免费网站 | 国产亚洲精久久久久久无码 | 国产精品一久久香蕉国产线看观看 | 国产精品无码一区二区在线观看 | 丰满岳乱妇在线观看中字无码 | 国产成人免费?在线视频 | 国产精品成人三级 | 国产午夜精品不卡观看 | 国产真实乱对白精彩久久 | 国产成人观看在线视频 | 国产一区麻豆剧传媒果冻精品 | 国产精品免费久 | 2025人人精品久久 | 国产免费一区二区三区最新 | 国产精品日韩欧美 | 国产欧美va欧美va香蕉在线观看 | 国产高清精品自拍av | av无码精品一区二区三区宅噜 | 黄色三级视频在线播放 |