Hey Everyone: I'm having trouble doing some simple multiplication in DTML, specifically: <dtml-call "REQUEST.set('value', unitPrice[_['sequence-index']])"> <dtml-call "REQUEST.set('qty', quantity[_['sequence-index']])"> <dtml-call "REQUEST.set('totalCost', qty*value)"> It's the last line that causes the error. I've tried a number of things, such as converting the variables to floats, all with no success. I receive the following Zope Error: Error Type: TypeError Error Value: Illegal sequence repeat I appreciate any help. -- John
This works for me: <dtml-let new_val="qty*value"> <dtml-call "REQUEST.set('totalCost',new_val)"> </dtml-let> __________________________________________________________________ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \ Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: jsanford@atinucleus.com Web: http://www.atinucleus.com Source Code, No Royalties, Any CPU...It just make sense ! __________________________________________________________________ ----- Original Message ----- From: John Fohrman <fohrman@mediaone.net> To: Zope Maliing List <zope-dev@zope.org> Sent: Wednesday, December 01, 1999 9:32 PM Subject: [Zope-dev] DTML Multiplication
Hey Everyone:
I'm having trouble doing some simple multiplication in DTML, specifically:
<dtml-call "REQUEST.set('value', unitPrice[_['sequence-index']])"> <dtml-call "REQUEST.set('qty', quantity[_['sequence-index']])"> <dtml-call "REQUEST.set('totalCost', qty*value)">
It's the last line that causes the error. I've tried a number of things, such as converting the variables to floats, all with no success. I receive the following Zope Error:
Error Type: TypeError Error Value: Illegal sequence repeat
I appreciate any help.
-- John
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev No cross posts or HTML encoding! (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Thanks, Jim, but this doesn't work; I still get the same error -- any other suggestions?
-----Original Message----- From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf Of Jim Sanford Sent: Wednesday, December 01, 1999 11:48 PM To: John Fohrman; Zope Maliing List Subject: Re: [Zope-dev] DTML Multiplication
This works for me: <dtml-let new_val="qty*value"> <dtml-call "REQUEST.set('totalCost',new_val)"> </dtml-let>
----- Original Message ----- From: John Fohrman <fohrman@mediaone.net> To: Zope Maliing List <zope-dev@zope.org> Sent: Wednesday, December 01, 1999 9:32 PM Subject: [Zope-dev] DTML Multiplication
Hey Everyone:
I'm having trouble doing some simple multiplication in DTML, specifically:
<dtml-call "REQUEST.set('value', unitPrice[_['sequence-index']])"> <dtml-call "REQUEST.set('qty', quantity[_['sequence-index']])"> <dtml-call "REQUEST.set('totalCost', qty*value)">
It's the last line that causes the error. I've tried a number of things, such as converting the variables to floats, all with no success. I receive the following Zope Error:
Error Type: TypeError Error Value: Illegal sequence repeat
I appreciate any help.
-- John
On Thu, 2 Dec 1999, John Fohrman wrote:
Thanks, Jim, but this doesn't work; I still get the same error -- any other suggestions?
<dtml-let new_val="qty*value"> <dtml-call "REQUEST.set('totalCost',new_val)"> </dtml-let>
Try: <dtml-let new_val="_.int(qty)*_.float(value)"> <dtml-call "REQUEST.set('totalCost',new_val)"> </dtml-let> qty and value might be strings (or something) rather than numeric types. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
Bingo! Thanks.
-----Original Message----- From: Stuart 'Zen' Bishop [mailto:zen@cs.rmit.edu.au] Sent: Thursday, December 02, 1999 2:11 AM To: John Fohrman Cc: Zope Maliing List Subject: RE: [Zope-dev] DTML Multiplication
On Thu, 2 Dec 1999, John Fohrman wrote:
Thanks, Jim, but this doesn't work; I still get the same error -- any other suggestions?
<dtml-let new_val="qty*value"> <dtml-call "REQUEST.set('totalCost',new_val)"> </dtml-let>
Try:
<dtml-let new_val="_.int(qty)*_.float(value)"> <dtml-call "REQUEST.set('totalCost',new_val)"> </dtml-let>
qty and value might be strings (or something) rather than numeric types.
-- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
participants (3)
-
Jim Sanford -
John Fohrman -
Stuart 'Zen' Bishop