[Zope] Beginner question: user defined variables
douwe@oberon.nl
douwe@oberon.nl
Fri, 2 Aug 2002 17:04:16 +0200
Hi Michael,
> <dtml-call "REQUEST.set('tot','tot' + charge_amt)">
What this line says, is to set a variable with the name
'tot' to 'tot'+charge_amt. You probably mean to add
tot (without the quotes) to charge_amt. Zope thinks you
try to add a float to a string and throws the reported
error.
First set 'tot' to 0:
<dtm-call "REQUEST.set('tot',0.0)">
then in the loop add to variable tot:
<dtml-call "REQUEST.set('tot',tot + charge_amt)">
And you should be all set.
Douwe