Exit program by user input

Jan 13, 2015 at 9:54pm
Hi Guys,

I'm half way through writing a program that requites the user to terminate at any point if they enter "999"

I know its fairly straight forward but I cant seem to find a simple answer anywhere, like is there just a line or two of code I can add to achieve this?

Jan 13, 2015 at 10:07pm
Depends on what your code looks like. It's usually something like a *break* if it's to terminate a loop, or a *return* if it's to end a function.
Jan 13, 2015 at 10:07pm
Before advising you, I'd like to know how you are getting the user's input.
Topic archived. No new replies allowed.