Suppose I need to break out of three or four nested for loops at once at the occurence of some event inside the innermost loop. What is a neat way of doing that?
If you're using Java, you can associate labels with each for block and then reference the label after a continue statement. For example:
outerfor: for (int i=0; i<5; i++) { innerfor: for (int j=0; j<5; j++) { if (i == 1 && j == 2) { continue outerfor; } } }