国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp中cint與clng的區別分析

2024-05-04 11:07:44
字體:
來源:轉載
供稿:網友
cint與clng含義都可以強制將一個表達式轉換成數據類型,介紹歸介紹,如果文章id一定要使用clng,不可能文章就32767篇的
 
 
 

cint與clng含義:

都可以強制將一個表達式轉換成數據類型

cint與clng處理數據的范圍:

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

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

'檢測是否是短整數 

復制代碼代碼如下:

sub Is_Int(string) 
if len(abs(string))>10 then response.write "數據溢出":response.end
if instr(string,"-")<1 then
if cint(left(string,4))>3276 and cint(right(string,1))>7 then response.write "數據溢出":response.end
else
if cint(left(abs(string),4))>3276 and cint(right(string,1))>8 then response.write "數據溢出":response.end 
end if 
end sub 

 

'檢測是否是長整數 

復制代碼代碼如下:

sub Is_Lng(string) 
if len(abs(string))>10 then response.write "數據溢出":response.end
if instr(string,"-")<1 then
if clng(left(string,9))>214748364 and clng(right(string,1))>7 then response.write "數據溢出":response.end
else
if clng(left(abs(string),9))>21478364 and clng(right(string,1))>8 then response.write "數據溢出":response.end 
end if 
end sub 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 子长县| 林口县| 贺兰县| 前郭尔| 边坝县| 康定县| 磐石市| 大关县| 炉霍县| 洛川县| 饶阳县| 合水县| 铁岭市| 金平| 丰原市| 肃宁县| 内丘县| 留坝县| 宝山区| 融水| 年辖:市辖区| 秀山| 灵石县| 凭祥市| 彰武县| 通江县| 蒲城县| 武义县| 安泽县| 长汀县| 商丘市| 修文县| 蒙阴县| 仁寿县| 毕节市| 鱼台县| 莫力| 岳阳县| 皮山县| 商水县| 商南县|