18.6.8 break
The break statement ends execution of the nearest do-while, for-next, switch-endswitch, or while-loop statement that encloses it. The control moves to the statement following the ended statement. The break statement is used to exit a loop.
- Organization of this subsection
(1) Format
- Jump statement
break;
(2) Description
The break statement is used to exit a loop before the end criterion is satisfied in the loop. Also, this statement may be used to exit a switch statement in a specific case. Unless the break statement is used within a repetitive statement or a switch statement, an error occurs.
You should not specify more than 255 break statements in a loop structure.
(3) Example of coding
i = 0; for(;;) AIT_LogMessage("Inside Loop"); i = i + 1; if(i>100) break; endif; next;