验证整数

来源:互联网 发布:送货单打印软件免费 编辑:程序博客网 时间:2024/05/18 03:12

Function IsInt(str)

    If IsNumeric(str) or  (len(str)>5) then

        IsInt=False

        Exit Function

    Else

        If (len(str)<5) then

            IsInt=True

            Exit Function

        Else

            If CInt(left(str,4))>3276 then

                IsInt=False

                Exit Function

            Else

                If CInt(Left(str,4))=3276 and CInt(Right(str,1))>7 then

                    IsInt=False

                    Exit Function

                Else

                    IsInt=True

                End If

            End If    

        End If

    End If

End Function