[Zope] How do you increment a variable?
Michel Pelletier
michel@digicool.com
Thu, 29 Jul 1999 10:26:00 -0400
> -----Original Message-----
> From: Tony McDonald [mailto:tony.mcdonald@ncl.ac.uk]
> Sent: Thursday, July 29, 1999 10:11 AM
> To: Zope List
> Subject: [Zope] How do you increment a variable?
>
>
> I am having a *bad* day, I don't seem to be able to get *any* of my
> Zope stuff to work today :(
>
> I can't get this to work.
> <dtml-let counter="1">
> Counter:<dtml-var counter>,
> <dtml-var counter="counter+1"> (Line A)
> <dtml-var counter>
> </dtml-let>
You can't do assignments inside Python expressions.
Of the top of my head, you might try:
<dtml-with "_(counter=1)"-->
<dtml-var counter>
<dtml-let counter="counter+1">
<dtml-var counter>
</dtml-let>
</dtml-with>
-Michel