Template Engine language reference > Directives > The #break directive

The #break directive
The #break directive will stop further processing of the current execution scope. An execution scope is essentially any directive with content, i.e. #foreach, #parse or #evaluate. Unlike #stop (see The #stop directive), #break will only stop the innermost, immediate scope, not all of them.
#set($count=10)
=====
#foreach($i in [0..$count])
#if($i>5)
#break
#end
$i
#end
=====
=====
0
1
2
3
4
5
=====
In the following example the file Calculate.txt is imported to the template using the #parse directive. The content of Calculate.txt is as follows:
#foreach($i in [0..$count])
#if($i>5)
#break
#end
$i
#end
#set($count=10)
=====
#parse('./Calculate.txt')
=====
=====
0
1
2
3
4
5
=====
 
OpenText StreamServe 5.6 Updated: 2013-03-01