[
https://issues.apache.org/jira/browse/VELOCITY-90?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henning Schmiedehausen closed VELOCITY-90.
------------------------------------------
> Break / return statement
> ------------------------
>
> Key: VELOCITY-90
> URL: https://issues.apache.org/jira/browse/VELOCITY-90
> Project: Velocity
> Issue Type: Bug
> Components: Testing
> Affects Versions: 1.3-rc1
> Environment: Operating System: All
> Platform: Sun
> Reporter: Parul Sheth
> Assigned To: Velocity-Dev List
> Fix For: 1.5
>
>
> 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
> #set( $count = 0 )
> #foreach ($sectiondataobject in $alSections)
> #countTabbedSection( $count )
> #set( $count=$count+1 )
> #end
>
> Thanks
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]