[Zope] adding values with <!--#in-->

Martijn Pieters mj@antraciet.nl
Mon, 12 Jul 1999 15:52:17 +0200


At 15:19 12/07/99 , Alexander Schad wrote:
>Hi!
>
>I'm iterating over a set of floating point values, using the <!--#in-->
>tag and want to add them up to get a total sum.
>Any clues?
>
>Bye,
>         Alex

Use a REQUEST variable:

<!--#call "REQUEST.set('total', 0.0)"-->
<!--#in FloatList-->
   <!--#call "REQUEST.set('total', total + _['sequence-item'])"-->
<!--#/in-->

Note: This code is untested. YMMV.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------