Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-90

Break / return statement

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 1.3-rc1
    • 1.5
    • Testing
    • None
    • Operating System: All
      Platform: Sun
    • 10974

    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

        1. 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            paroolsheth@yahoo.com Parul Sheth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: