Details
Description
Please answer this as soon as possible: how do i break from a loop / return a
value from a macro based on some condition
Please have a look at this code
#macro ( countTabbedSection $position )
position = $position
#set ($loopend = $alSections.size() - 1)
#foreach ($count in [$position..$loopend])
#set( $sectiondataobject = $alSections.get($count) )
#if ($sectiondataobject.getIsTabbed()==1)
sectiondataobject.getIsTabbed() = $sectiondataobject.getIsTabbed()
#else
-
- i want to break this loop here
#end
#end
#end ## end of macro
- i want to break this loop here
#set( $count = 0 )
#foreach ($sectiondataobject in $alSections)
#countTabbedSection( $count )
#set( $count=$count+1 )
#end
Thanks