my task is to set a certain value limit (Int32.MaxValue) for the user input. If the user exceeds this he should repeat the input. How do i get out of the exception without crashing my whole code?
This is my newbie method so far:
public bool ValidateValue()
{
long value = Int32.Parse(UserValue);
if (value>Int32.MaxValue)
{
Console.WriteLine("[ERROR] Too large number! The limit is: {0} \n Please repeat your input. ", Int32.MaxValue);
return false;
}
}`