[Zope-dev] Iteration counter

Danny William Adair danny@adair.net
Wed, 19 Dec 2001 10:24:31 +1300


On Wednesday 19 December 2001 10:11, Jon Erickson wrote:
> I need a to create a simple counter variable that will store the number of
> iterations by a <dtml-in> structure.  I have yet to find a way how to do
> this in zope.  Here is an example (in perl) of what I need to do:

The number of iterations are already available as:
sequence-index (starting at 0) and
sequence-number (starting at 1)

hth,
Danny

>
> @bar = ("sara","jane","kate");
>
> foreach $foo (@bar) {
>       print "$foo\n";
>       $counter = $counter + 1;
> }
>
> I will need to use the $counter variable later on in the script.  Does
> anyone know how I can do this in zope?
>
> Thanks,
>
> Jon Erickson
>
>
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )