[TOC] [Prev] [Next] [Bottom]



<@BREAK>

Description

Terminates execution of an <@COLS>, <@ROWS>, or <@FOR> block. <@BREAK> causes execution to continue to the HTML following the current loop's close tag; outside of a loop, it does nothing. This tag has no attributes. This tag does not affect loops initiated with For Loop or While Loop actions.

This tag is generally used with an <@IF> tag to terminate a loop when some condition is met. Be careful to handle nested loops properly: only the innermost loop's processing is affected by the break.

Example

The following example returns records until the accumulated total of all the company.balance columns reaches or exceeds 1000:

<@ASSIGN NAME="running_total" VALUE="0">
<@ROWS>
Here are the values from record <@CURROW>
of the results:<P>
<STRONG>Company Name:</STRONG> <@COLUMN NAME="company.name"><BR>
<STRONG>Balance</STRONG> $<@COLUMN NAME="company.balance"><BR>
Running total: $<@NEXTVAL NAME="running_total" STEP='<@COLUMN NAME="company.balance">'>
<@IF EXPR="@@running_total>=1000" TRUE="<@BREAK>">
</@ROWS>
Running total of balance has reached $1000. End of records.

See Also

<@COLS> </@COLS>
<@CONTINUE>
<@EXIT>
<@FOR> </@FOR>
<@ROWS> </@ROWS>



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1998, Pervasive Software Inc. All rights reserved.