[Zope] How do you increment a variable?

Michel Pelletier michel@digicool.com
Thu, 29 Jul 1999 10:48:07 -0400


> -----Original Message-----
> From: Tony McDonald [mailto:tony.mcdonald@ncl.ac.uk]
> Sent: Thursday, July 29, 1999 10:40 AM
> To: Michel Pelletier; Zope List
> Cc: Zope List
> Subject: RE: [Zope] How do you increment a variable?
> 
> 
> 
> This does work, I then tried to extend it with
> <dtml-with "_(counter=1)">
>    <dtml-var counter>
>    <dtml-in "_.range(0,10)">
>    <dtml-let counter="counter+1">
>      <dtml-var counter>
>   </dtml-let>
> </dtml-in>
> </dtml-with>
> 
> and got 1 2 2 2 2 2 2 2 2 2 2.
> Is that because the <dtml-in> tag sets up another name space?

Yep.  Do the 'in' inside the 'let'.

-Michel

> ------
> Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
> http://nle.ncl.ac.uk/
> The Medical School, Newcastle University Tel: +44 191 222 5888
> Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2
>