<form id="hz9zz"></form>
  • <form id="hz9zz"></form>

      <nobr id="hz9zz"></nobr>

      <form id="hz9zz"></form>

    1. 明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

      檢測整數與長整數的函數

      [摘要]經常見到cint和clng的溢出出錯,如果有檢測函數就不會出這個問題,下面這兩個函數是應朋友要求寫的,看一下吧'檢測字符串是否是整數function Is_Int(a_str) if n...
      經常見到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




      日韩精品一区二区三区高清