[Zope] kind of variable in a document

Jim Washington jwashin@vt.edu
Fri, 10 Mar 2000 14:30:56 -0500


Hi, Laurent

Something like the following should work.

<dtml-call "REQUEST.set('mylist', [0,1,2,3,4,5,6])">
<dtml-call "REQUEST.set('cusum', 0)">
<table>
<dtml-in mylist>
  <dtml-let myvar=sequence-item>
  <dtml-call "REQUEST.set('cusum', cusum + myvar)">
  <tr><td><dtml-var myvar></td><td><dtml-var cusum></td></tr>
  </dtml-let>
</dtml-in>
</table>



-- Jim Washington


Laurent Chane-Chuen-Kee wrote:
> 
> Hello,
> 
> I am trying to display a sequence of numbers with next to each of them the
> cumulated value of the previous ones. Thus, I was trying to declare a variable
> buffer to add at each cycle the value of the new number. But I can't figure
> out how to create a variable.
> 
> Can somebody tell me how to declare such variable?
> 
> Thanks,
> Laurent
> 
> --
> Laurent Chane-Chuen-Kee
> A X I O M  (Cambridge) Ltd.
> Tel: +44 (0)1223 810 305           Fax: +44 (0)1223 812 889