0

i can trap Number only but i cant trap letter inputs. how to do that? please?

example.

Enter a letter: 5

"INVALID INPUT! PLEASE ENTER A NUMBER!"

please guys?!

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by stultuske
0

i can trap Number only but i cant trap letter inputs. how to do that? please?

example.

Enter a letter: 5

"INVALID INPUT! PLEASE ENTER A NUMBER!"

please guys?!

if you want us to see where you're going wrong in your code, you'll have to show us your code, not what you get on your DOS prompt.

for instance, if you've coded it to generate an error message as soon as you enter '5', then your code is working perfectly fine, but impossible for us to know.
Since we also can't see what you're using to read the char, are you sure he's not taking the blank space that stands before the 5?

depending on your code, that might give a problem as well.

but most important is: what exactly do you need? do you need to read characters, or will you, on some point, have to read input that contains more than one char?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.