Bookmark and Share Share

<break>

This statement forceably stops loop processing for <for>, <foreach> or <while> statements. You can also use this in <if>, <elseif> or <else> statements if they are descendants of a looping statement.

You don't need to supply any additional information or content for <break>.

The following example shows <break/> used inside <if> to determine when to break loop processing for a <while> statement:

... 
<while condition="true()"> 
  <display message="while-loop: " expr="$cnt"/> 
  <assign fromexpr="$cnt + 1" outputvariable="cnt"/> 
  <if condition="$cnt > 10"> 
    <display message="enough already..." /> 
    <break/> 
  </if> 
</while>