next up previous contents
Next: 3.2 MDL Classes Up: 3.1.10 Controlling the Program Previous: The break Statement The continue Statement

With the continue expression the execution of MDL statements within the body of any kind of loop expressions is immediately interrupted and the conditional expression evaluated. If the condition results in the true value, the loop is continued at the first expression of expression_list.

Example 3.9 demonstrates a possible usage of continue and break statements by extracting a list of all dopants chargedDopings with positive or negative charge out of the list of all available dopants. Any dopant with an internal type different from concentration will cause an error and the while statement to be aborted.


while(iter) {
  if ( getType(dopants[iter]) != "concentration" ) {
    reportError("Wrong quantity type"); break;
  if ( getCharge(dopants[iter])==0 ) {
    iter++; continue;

Example 3.9: break and continue statements

Robert Mlekus