[Templates] Using FOREACH i IN [0 .. max]

Buddy Burden buddy@thinkgeek.com
Fri, 27 Apr 2007 20:55:02 -0400


Mark,

> I might have picked a bad variable name. The reason for using 0 ..
> LISTSIZE-1 is how the value is given to me. I don't actually get a list;
> I just get a max value that's 1-based. So I'm using TT files to create
> strings which iterate from 0 to LISTSIZE-1.

Then go with the [% UNLESS loop.last %], I suppose.  Either that, or make your loop from 1..LISTSIZE, ignore [% i %], 
and use [% loop.index %] instead.


		-- Buddy