View Single Post
Old 10-09-2012, 01:44 PM   PM User | #12
tbmtbm
New to the CF scene

 
Join Date: Sep 2012
Posts: 7
Thanks: 5
Thanked 0 Times in 0 Posts
tbmtbm is an unknown quantity at this point
I'm trying to get the error handling down. I've added the following statement:

if(reply != "Stars" || reply != "S" || reply != "Planets" || "P" ||); {
number = prompt(reply + " is improper input!!- run the program again.")

But this makes it so an error message comes up when the user types in the number for the star or planet. I just saw something called try/catch/finally. Is that the correct way to handle invalid input?
tbmtbm is offline   Reply With Quote