On Mon, 12 Apr 2004, Aleksandr Guidrevitch wrote:

> Dave Cash wrote:
>
> >
> >How about this?
> >
> > [% avar = [0,1,2] %][% WHILE avar.size %][% avar.shift %][% END %]
> >
> >
> Well, the for me the problem is more complicated: I have iterator which
> returns numbers:
> [% WHILE (var = iterator.next) %] ... [% END %]
> If iterator.next returns 0 the loop fails :(

If your iterator is a Template::Iterator, you can just do:

 [% FOREACH var IN iterator %][% var %][% END %]

Dave

/L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\
Dave Cash                              Power to the People!
Frolicking in Fields of Garlic               Right On-Line!
[EMAIL PROTECTED]                                  Dig it all.

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to