5 Aug
2004
5 Aug
'04
7:35 p.m.
----- Original Message ----- From: "Marc Burgauer" <marc@sharedbase.com>
I want to do some math in DTML, here an example:
<dtml-let myCounter=0> <dtml-in expr="some_method(_['a_current_id'])">
<dtml-if checked> <dtml-call expr="myCounter=myCounter+1"> </dtml-if>
</dtml-in>
<dtml-if expr="myCounter>0">
DO SOMETHING!
</dtml-if>
</dtml-let>
"some_method" returns a sequence where some items might have an attribute "checked". So while I iterate over the sequence I want to change the value of "myCounter".
You need to set up and manipulate the counter as follows: <dtml-call "REQUEST.set('myCounter', 0)"> <dtml-call "REQUEST.set('myCounter', myCounter+1)"> This would be much cleaner in a python script. HTH Jonathan