Description
The break statement works only within a loop (such as for/next, do/until, while/wend) and is somewhat like the continue statement. Instead of skipping a loop iteration like continue, break terminates the current loop and resumes execution at the first statement following the loop body.
break is recommend over the older exit xxxx statements (like exit for/exit next) because the exit family of statements override any smart branching decisions the LLVM clang compiler may make. For example, exit for, when there are two or more nested loops (say a while inside a for loop), can be used to exit not only the inner while loop but also the outer loop. This can potentially bypass compiler optimizations and memory managment and is therefore risky.