In DTML, does anyone know how to perform math on a dtml-in sequence- number attribute. For example sequence-number == sequence-number - 1 Thanks! Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
--On Dienstag, 14. Oktober 2003 9:21 Uhr -0600 hpinson@indepthl.com wrote:
In DTML, does anyone know how to perform math on a dtml-in sequence- number attribute. For example
sequence-number == sequence-number - 1
the variable defined by dtml-in should *never* be modified. they are readonly. -aj
Hello hpinson, use the prefix attribute of dtml-in, e.g <dtml-in sqlQuery prefix=seq> <dtml-var "seq_number-1"> is equal <dtml-var seq_index> or <dtml-var sequence-index> </dtml-in> Hope it helps Ulrich -- World Wide Web Publisher, Ulrich Wisser, Vallatorpsv.158, S-18752 Täby http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06
Sure: You need to escape it because python doesn't recognize the dash in a variable name. _['sequence-number'] Double = is used for comparison only. I would also create a new var instead of working on sequence-number directly. Laters, Rick hpinson@indepthl.com wrote:
In DTML, does anyone know how to perform math on a dtml-in sequence- number attribute. For example
sequence-number == sequence-number - 1
Thanks!
Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Hi Harlow, hpinson@indepthl.com wrote:
In DTML, does anyone know how to perform math on a dtml-in sequence- number attribute. For example
sequence-number == sequence-number - 1
You dont do that. sequence-number is read only. _['sequence-number'] if you need it in an expression. If you have more complicated logic, use a python script. What, btw. do you want to achieve with the above expression? Regards Tino
btw. do you want to achieve with the above expression?
Hi Tino-- just some if then logic and text substitution, ie. Grade 0 becomes Grade K where 0 is kindergarten, 1 is grade 1, etc. The grade is the same as the sequence number. I'll use the expression and assign this value to a different variable. Thanks! Harlow Pinson Indepth Learning Email: hpinson@indepthl.com Web: http://www.indepthl.com Voice: 505-994-2135 FAX: 208-475-7678
participants (5)
-
Andreas Jung -
D. Rick Anderson -
hpinson@indepthl.com -
Tino Wildenhain -
Ulrich Wisser