954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

exception error

How do I handle an exception error if a user enters nothing or a letter into the input box when I have it declared as an integer.

--------------------------------------------------------------------------------

cwb01
Newbie Poster
1 post since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Try...catch perhaps.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

You say that

if input is <= 0 then
whatever error message.

Anything entered that is not an integer, when the data type is integer, it is considered less than (or in some cases equal to) 0 if I am not mistaken. This should also take care of it if a user enters nothing (which I'm pretty sure is considered as a value of 0).

sk8ndestroy14
Posting Virtuoso
1,852 posts since Mar 2007
Reputation Points: 437
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You