[Templates] loop.first, loop.last

Birgit Kellner birgit.kellner@univie.ac.at
Sat, 10 Jun 2006 12:13:13 +0200


Hi,

I'm looping through an array of hashes with "foreach" and have problems 
using "loop.last":

<p>
<% foreach record in record_list %>
<% record_lastname>, <% record.firstname %><% if not loop.last%>; <% end %>
<% end %>:
</p>

However, the Template module throws an error:
file error - parse error - pub_author.tmpl line 3: unexpected token 
(LAST) [% if not loop.last %].

The same error is thrown by "unless loop.last".

Can someone please explain this to me?

Thank you, and best regards,

Birgit Kellner