Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel eScript Language Reference > Siebel eScript Language Overview > eScript Statements >
break Statement
The break statement terminates the innermost loop of for, while, or do statements. It is also used to control the flow within switch statements.
Syntax A
break;
Syntax B
break label;
Returns
Not applicable
Usage
The break statement is legal only in loops or switch statements. In a loop, it is used to terminate the loop prematurely when the flow of the program eliminates the need to continue the loop. In the switch statement, it is used to prevent execution of cases following the selected case and to exit from the switch block.
When used within nested loops, break terminates execution only of the innermost loop in which it appears.
A label may be used to indicate the beginning of a specific loop when the break statement appears within a nested loop to terminate execution of a loop other than the innermost loop. A label consists of a legal identifier, followed by a colon, placed at the left margin of the work area.
Example
For an example, read switch Statement.
See Also
do...while Statement, for Statement, if Statement, and while Statement
Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel eScript Language Reference Published: 18 April 2003 |