Checking If Text Input Is Numeric

Discussion in 'Archives' started by halojunkie, Jun 8, 2007.

Checking If Text Input Is Numeric
  1. Unread #1 - Jun 8, 2007 at 1:00 AM
  2. halojunkie
    Joined:
    Dec 17, 2005
    Posts:
    232
    Referrals:
    0
    Sythe Gold:
    0

    halojunkie Active Member

    Checking If Text Input Is Numeric

    How do I check if text input to a text box is numeric?

    i tried:

    Code:
    private sub command1_click()
    if text1.text is numeric then
    blah
    else
    blah
    end if
    end sub
    
    and it didnt like it
     
  3. Unread #2 - Jun 8, 2007 at 1:04 AM
  4. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    Checking If Text Input Is Numeric

    wrong syntax. i believe there's a function called isNumeric, so:
    Code:
    private sub command1_click()
    if isNumeric(text1.text) then
    blah
    else
    blah
    end if
    end sub
    would probably do it.
     
  5. Unread #3 - Jun 8, 2007 at 1:08 AM
  6. halojunkie
    Joined:
    Dec 17, 2005
    Posts:
    232
    Referrals:
    0
    Sythe Gold:
    0

    halojunkie Active Member

    Checking If Text Input Is Numeric

    thanks. i knew it was sumthin like that
     
< Buying a pin | selling lvl 74 ownage acc >

Users viewing this thread
1 guest


 
 
Adblock breaks this site