velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary M. Catlin" <>
Subject Working with lists
Date Fri, 19 May 2006 17:35:46 GMT
I need a little guidance on working with lists. I am attempting to copy 
a subset of the content from one list into a new list, where each 
element in the list is a class. I have been told that there is no simple 
way of filtering the content of a list, short of examining each record 
using #foreach. How do I go about creating the new list a record at a 
time? My guess would be something in the line of:

#foreach ($record in $oldList)
  #if ($ == "match")
    #set ($newList[n] = $record) ** pseudo-code -- what do I really do here?
  #end ## end if
#end ## end foreach

Or is there a better way to accomplish my goal?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message