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

首頁 > 學院 > 開發設計 > 正文

檢測整數和長整數的函數

2019-11-18 21:29:37
字體:
來源:轉載
供稿:網友
經常見到cint和clng的溢出出錯,如果有檢測函數就不會出這個問題,下面這兩個函數是應朋友要求寫的,看一下吧

'檢測字符串是否是整數
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

'檢測是否是長整數
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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金华市| 南丰县| 华宁县| 潜山县| 府谷县| 新巴尔虎右旗| 富锦市| 若羌县| 江孜县| 兰坪| 原平市| 邯郸县| 赣榆县| 嘉义县| 镇原县| 康乐县| 澄城县| 丘北县| 来凤县| 柏乡县| 历史| 增城市| 汪清县| 沅陵县| 蕉岭县| 石河子市| 柘城县| 呼图壁县| 资兴市| 津南区| 化隆| 邢台县| 社旗县| 南城县| 桦甸市| 天门市| 东安县| 德庆县| 华蓥市| 丁青县| 尉氏县|