Results 1 to 4 of 4

Thread: Number Checking

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    Anybody know a simple routine that checks whether a string is valid number or not?

    Any help would be good.

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Code:
    MsgBox IsNumeric(MyStr)
    will do the job!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243

    Thumbs up

    Hi,
    Use VB's IsNumeric function.

    Example:
    Code:
    Dim strTemp As String
    dim IsAString As Boolean
    
    strTemp = "1j2k34"
    IsAString = IsNumeric(strTemp) 'Returns False
    
    strTemp = "8656"
    IsAString = IsNumeric(strTemp) 'Returns True
    Hope this helps

    Shaun
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  4. #4
    Guest
    French:
    Oui, monsieur, il sais:
    Code:
    IsNumeric("String")
    Parlez-vous français où anglais?


    Chinese:
    Huede, xianshong, zheshzaidingshong.


    Spanish:
    Sí, señor.


    English:
    Yes, mister.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width