SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: check input to be an integer
-
May 20, 2005, 08:18 #1
- 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
-
May 20, 2005, 12:04 #2
- 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.
"Does this napkin smell like chloroform?"
...now with SnapFoo!
My Blog | My Twitter | My Company | SitePoint Podcast
*** Matt Mullenweg on the SitePoint Podcast ***
Bookmarks