* Andrew Beattie <[EMAIL PROTECTED]> [2002-12-07 16:15]:
> I want to do a FOREACH through several lists.
>
> I find myself doing:
>
> [% one = [ "a", "b", "c" ] %]
> [% two = [ "d", "e", "f" ] %]
> [% three = [ "g", "h", "i" ] %]
> [% unwanted_list = [] %]
> [% FOREACH item = unwanted_list.merge(one, two, three) %]
>    [% item %]
> [% END %]
>
> Am I missing a trick?

You can eliminate unwanted_list:

  [% one = [ "a", "b", "c" ] %]
  [% two = [ "d", "e", "f" ] %]
  [% three = [ "g", "h", "i" ] %]
  [% FOREACH item = one.merge(two, three) %]
    [% item %]
  [% END %]

But not too much else.  This doesn't modify one, merge returns the
merged list but doesn't merge in place.

(darren)

--
You'd be suprised how easy it is to change my mind if you give
me the facts.

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.ourshack.com/mailman/listinfo/templates

Reply via email to