-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

* Clayton L. Scott <tex at engsoc.org> [2003-03-21 13:37]:
> After so much success with me writing what I thought would work and TT
> just Doing What I Mean I was surprised when loop.count didn't work
> here in a WHILE loop like so:
> 
> [% WHILE ( obj = iterator.next ) %]
>       [% rowAttr = loop.count mod 2 ? '' : 'class="altRow"' %]
> 
>       <tr[% " $rowAttr" %]>
>               <td> [% obj.something %]</td>
>               <td> [% obj.otherthing %]</td>
>       </tr>
> [% END %]

But this is exactly what a FOREACH loop is, so just rewrite your code:

  [% FOREACH obj = iterator.next %]

(darren)

- -- 
If NT is your answer, you don't understand the question.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (SunOS)

iD8DBQE+e2nyzsinjrVhZaoRAqKOAKCU5eHhR4ryl4CGj+PKEwB8eWHmqwCgiUAf
rWLssCQhTwy+GzU0scm7T/w=
=Bk0c
-----END PGP SIGNATURE-----

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

Reply via email to