isbreak Element

Syntax

<isbreak/>

Purpose

Terminating loops unconditionally.

<isbreak> can be used within a loop (defined by an <isloop> tag) to terminate a loop unconditionally. For more information on creating loops see <isloop>. If <isbreak> is used in a nested loop, it terminates only the inner loop.

Example

In this example, <isbreak/> terminates the loop after showing three product names; even if the products iterator contains more than three products.

<isset name="counter" value="${0}">
<isloop iterator="${pdict.Basket.product}" var="product" status="status">
  <isprint value="${product.name}"> <BR>
  <isif condition="${status.counter >= 3}">
    <isbreak/>
  </isif>
</isloop>