Catching Input Errors
Posted: Mon Aug 08, 2022 2:17 pm
I am writing a simple program where the user is asked to input the integers 1 or 2.
To catch the error of them putting in a different integer I put in a line: If X <> 1 or X etc
But I’ve noticed that if I input another key that isn’t an integer the program ends. Terminates at the Input X line.
How do I catch this error?
To catch the error of them putting in a different integer I put in a line: If X <> 1 or X etc
But I’ve noticed that if I input another key that isn’t an integer the program ends. Terminates at the Input X line.
How do I catch this error?