[Zope] - Can't make the DTML example work ;-(

lstep@mail.dotcom.fr lstep@mail.dotcom.fr
19 Dec 1998 12:50:59 +0100


Hello,

I tried the example you give about DTML (counter), but I get an error
about the line that increments the variable.
I don't understand why, as I followed exactly the given directions.

Here is what I made:
1) create a 'counter' variable in the folder properties
(id=counter, type=int, initial value=0)
2) The I added to the index_html method:

<!--#call expr="counter=counter+1"-->
Counter: <!--#var counter-->

When I try to view the page, I get the following error:
==================
Sorry, an error occurred.<p>
<!--
Traceback (innermost last):
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 879, in publish_module
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 595, in publish
    (Info: /vitrine1/index_html/manage_edit)
  File /usr/local/Zope/lib/python/OFS/Document.py, line 261, in manage_edit
    (Object: index_html)
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 372, in munge
    (Object: index_html)
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 388, in cook
    (Object: index_html)
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_String.py, line 239, in parse
    (Object: index_html)
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_Var.py, line 318, in __init__
  File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 321, in name_param
    (Info: ({'expr': 'counter=counter+1'}, 'call', 1, 'name'))
  File /usr/local/Zope/lib/python/DocumentTemplate/VSEval.py, line 170, in __init__
    (Object: counter=counter+1)
  File "<string>", line 1
     counter=counter+1
            ^
 SyntaxError: invalid syntax
===================

Can anyone explain me what's wrong ?

Thanks,
Luc