Hey all,

I am wondering if you can help me with a looping question.  I looked through 
the user forum and found a good example by Shinobu.  In trying to duplicate it, 
I am getting odd results.   My use is below:

  #set ($wrapper = $iteratorWrap.wrap($largeCollectionOfStuff))
  #foreach ($item in $wrapper)
    #if ($velocityCount >= $endingRecord)
      $wrapper.stop()
    #elseif ($velocityCount >= $beginningRecord)
       $item.toString()
    #end
  #end

This seems pretty straight forward, but using it as such only causes one item 
to print out once.  It only executes the foreach once.

When I place $wrapper.more() before the last #end, it causes it to cycle 
through all of the records but it also causes the records to print out.  I do 
not want a print out.

I am trying to prevent looping through potentially enormous amounts of records.

Also I am wondering how a "continue" might be handled.   I am not very sure how 
velocity parsing would be handled if it has to parse to the last #end on each 
loop when the #end can be past lots of logic.    I would think having not just 
a #stop (aka break) would be useful, but a #continue.

Any ideas on this?


Thank you.  I am just trying to optimize as my very old C skills had trained me.

JohnE




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to