In this code sample, is there any way to continue on the outer loop from the catch block?
while
{
// outer loop
while
{
// inner loop
Use an own exception type, e.g., MyException. Then:
while
{
try {
// outer loop
while
{
// inner loop
try
{
throw;
}
catch
{
// how do I continue on the outer loop from here?
throw MyException;
}
}
} catch(MyException)
{ ; }
}
This will work for continuing and breaking out of several levels of nested while statements. Sorry for bad formatting ;)