Pete Kazmier writes:
 > I'm trying to keep a cumulative count while sequencing over a list via
 > the dmtl-in tag.  I tried this but it didn't work, Zope complained
 > about the syntax....
 > 
 > <dtml-let totalActive="0">
 > 
 > <dtml-in "objectValues(['Gateway'])">
 >   <dtml-with sequence-item>
 >     <dtml-var "totalActive=totalActive+active">
 >   </dtml-with>
 > </dtml-in>
I can tell you, why you get the syntax error.
Luis Cortes has told you, how you could do your job.


Explanation:
  Python distinguishes between expressions which can be "eval"ed
  and commands which can be "exec"ed.
  Assignments are commands, as are definitions, if, for, while constructs.

  Zope uses "eval" to evaluate expressions in DTML-tags.
  "eval" raises a SyntaxError when confronted with a command.

Dieter

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to