velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Lea <Ryan....@Rightmove.co.uk>
Subject Setting values in an array list
Date Mon, 05 Jan 2004 17:22:21 GMT
Hi all,

This is potentially a daft question, BUT I couldn't find anything in the
users list.  Is there a way to set values of an array from within a foreach
loop?

Eg:

#foreach ( $i in [0..50] )
   ## somehow set position $i in the array to the corresponding value
#end

OR

#set ( $array1 = ['a', 'b', 'c', 'd', 'e'] )
#set ( $array2 = ['z', 'y', 'x', 'w', 'v'] )

#foreach ( $value in $array1 )
   ## somehow set the value in the array2 as the same as in array1
#end

Cheers

Ryan


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs service. 
________________________________________________________________________
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message