asp中cint與clng的區(qū)別分析_ASP教程
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!
推薦:Asp Split函數(shù)之使用多個(gè)分割符的方法有時(shí)候用戶輸入的分隔符種類(lèi)比較多,支持逗號(hào)也想要支持空格等等,其實(shí)原來(lái)就是先統(tǒng)一為一中分隔符再使用split進(jìn)行分割就可以了
cint與clng含義:
都可以強(qiáng)制將一個(gè)表達(dá)式轉(zhuǎn)換成數(shù)據(jù)類(lèi)型
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ù)防止溢出的代碼,大家可以自己看看:
'檢測(cè)是否是短整數(shù)
復(fù)制代碼 代碼如下:www.hl5o.cn
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
'檢測(cè)是否是長(zhǎng)整數(shù)
復(fù)制代碼 代碼如下:www.hl5o.cn
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
分享:ASP中Split分割字符串函數(shù)的實(shí)例用法ASP中Split函數(shù)的用法,用split分割截取字符串,看幾個(gè)例子就能理解了
相關(guān)ASP教程:
- asp FSO 讀寫(xiě)文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫(kù)實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過(guò)濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁(yè)模板:ASP內(nèi)建對(duì)象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無(wú)組件分頁(yè)實(shí)現(xiàn)思路及代碼
ASP教程Rss訂閱編程教程搜索
ASP教程推薦
- ADO初學(xué)者教程:ADO 添加記錄
- 初學(xué)者來(lái)認(rèn)識(shí)OLEDB和ODBC的區(qū)別
- asp中日期時(shí)間函數(shù)介紹
- 動(dòng)態(tài)網(wǎng)頁(yè)技術(shù)ASP日期和時(shí)間函數(shù)示例
- 解讀初學(xué)ASP編程易犯的一個(gè)錯(cuò)誤
- 用ASP進(jìn)行網(wǎng)絡(luò)打印的功能
- 總是彈出visual studio 實(shí)時(shí)調(diào)試器 三種解決辦法
- 揭秘escape解決AJAX中文亂碼的簡(jiǎn)單方法
- 通過(guò)實(shí)例講解來(lái)學(xué)習(xí)ASP中的函數(shù)
- ASP編程Session技巧
- 相關(guān)鏈接:
- 教程說(shuō)明:
ASP教程-asp中cint與clng的區(qū)別分析
。