|
-
November 2nd, 2011, 11:54 AM
#1
.net v3.5 readline errors when user submits null or string
I am writing a console application, that gives the user a numerical choice to pick from (1-3). I have my logic down correctly, so that if they select 1-3 it works, but will cycle back through the loop if they choose any number outside that range and write a string error message "Invalid Entry! Please select 1-3 only.".
The problem I am running into is that if you just hit enter, without entering anything at all, it errors out. Or if you submit an alpha character instead of a number, it also errors out. How do I write it so that null entries or string/char entries will not bug it out when it is looking for only an int entry?
Thanks in advance for any help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|