- Theme Engine
- Design Principles
- Templates
- EVML Reference
- Output
- Comments
- Operators
- Statements and Declarations
- Built-in Functions
- Built-in Objects
- Account
- Address
- Array
- Boolean
- Branch
- Cart
- CartLine
- Category
- CategoryCollection
- CategoryFilter
- CategoryFilterCollection
- CategoryFilterOption
- CategorySearch
- Collection
- Color
- Contact
- Currency
- Date
- Discount
- Dom
- Event
- EventCollection
- EventSlot
- Image
- Layout
- Locale
- Money
- Number
- Object
- Page
- PageCollection
- PageSearch
- PageSharer
- Pagination
- Postage
- Price
- PriceDiscount
- Product
- ProductCollection
- ProductCustomisation
- ProductDownload
- ProductMedia
- ProductMediaFrame
- ProductPrice
- ProductSearch
- ProductSpecification
- ProductSpecificationValue
- ProductVariation
- ProductVariationOption
- RecentlyViewed
- RegExp
- Request
- Review
- ReviewCollection
- Search
- SearchCollection
- SearchResult
- String
- Tag
- Template
- Url
- Website
- EV Tags
- CSS Pre-processor
- Ajax API
break
The break
statement exits from the current for
, for..in
, for..of
, switch
,
or while
statement and transfers execution to the statement
following the terminated statement.
Syntax
break;
Example: break out of a loop
The following example is similar across
for
,
for..in
,
for..of
,
and while
statements and breaks out of a loop.
<?ev
for(var i=0; i<5; i++){
if(i==3){
break;
}
print(i);
}
?>
Example: break out of a switch
The following example illustrates breaking out of a switch
statement from a case clause.
<?ev
switch(val){
case 1:
print('One');
break;
case 2:
print('Two');
break;
default:
print('Many');
}
?>
See also continue