SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2004
    Location
    UK
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    check input to be an integer

    Hello people

    I am trying to test a users input to be an integer. Is there a simple function that i can use.

    Here is a simplified version of my attempt

    dim numTestNumber
    numTestNumber = 6
    if isNumeric(numTestNumber) = false then
    Response.Write "The input must be numeric"
    Response.End
    end if

    if Cint(numTestNumber) then
    Response.Write "The Number is an Integer"
    else
    Response.Write "The Number is not an integer"
    end if

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You got it right already. Of course if the variable is not an integer your response.end will stop the script and never execute the second IF statement.


Bookmarks

Posting Permissions

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