国产探花免费观看_亚洲丰满少妇自慰呻吟_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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 伊春市| 保靖县| 合江县| 延长县| 平安县| 波密县| 大厂| 本溪| 和田市| 航空| 辽宁省| 嘉祥县| 古浪县| 福贡县| 高要市| 远安县| 泗阳县| 锦州市| 禄丰县| 南汇区| 唐山市| 浦县| 东丰县| 天长市| 永仁县| 金塔县| 古交市| 靖宇县| 博兴县| 海门市| 龙泉市| 个旧市| 斗六市| 航空| 治县。| 抚松县| 蚌埠市| 三台县| 新竹县| 固镇县| 资兴市|