I want to be able to run the Main function again if the user doesn't input the correct information.
Asked
Active
Viewed 550 times
-3
-
1I think what you'd want to do is run a while loop until the user enters the correct input. – Dan Weber Mar 28 '17 at 17:09
-
Possible duplicate of [loop input request until valid number accepted](http://stackoverflow.com/questions/13098715/loop-input-request-until-valid-number-accepted) / http://stackoverflow.com/questions/3732673/how-do-i-make-an-console-application-run-until-the-user-enters-q-q-quit – Alex K. Mar 28 '17 at 17:14
-
See marked duplicate http://stackoverflow.com/questions/19655806/how-to-call-static-void-mainstring-args-in-the-class-again for the _exact duplicate_ question to yours. It includes a literal answer, which is awful, and better alternatives, as do the other two marked duplicates. You really shouldn't be calling `Main()` again...use some other technique to repeat execution of the code in a reliable way. – Peter Duniho Mar 28 '17 at 17:20
-
I'm a beginner programmer as you can see. I will utilize the while loop then. Thank you guys for your prompt response! I'm starting to see why calling Main again wouldn't be good. Right now, I'm just dealing with a console application. As I progress, I'm sure calling Main would be more devastating – drethedevjs Mar 28 '17 at 17:24