Another quick question
Hello All, Tell me if I'm missing something. I can write <dtml-let temp="1 + 1"> and then use <dtml-var temp> to get the value 2. Then why can't I use a variable and increment it using <dtml-let> ? <dtml-let temp="REQEUST.myVar + 1"> I get an error : Error Type: TypeError Error Value: illegal argument type for built-in operation The variable has the value of 1, so it should just add 1 an' 1 to give me 2. Correct, yes/no? Thanks in advance, Tommy
It looks myVar is of string type. You have to typecast it to integer. <dtml-call "REQUEST.set('myVar','1')"> <dtml-let temp="_.int(REQUEST.myVar) + 1"> <dtml-var temp> </dtml-let> --- Tommy Johnson <tommy@7x.com> wrote:
Hello All,
Tell me if I'm missing something. I can write
<dtml-let temp="1 + 1"> and then use <dtml-var temp> to get the value 2.
Then why can't I use a variable and increment it using <dtml-let> ?
<dtml-let temp="REQEUST.myVar + 1">
I get an error : Error Type: TypeError Error Value: illegal argument type for built-in operation
The variable has the value of 1, so it should just add 1 an' 1 to give me 2. Correct, yes/no?
Thanks in advance, Tommy
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
__________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Tommy Johnson
Then why can't I use a variable and increment it using <dtml-let> ?
<dtml-let temp="REQEUST.myVar + 1">
try: <dtml-call "REQUEST.set('myVar', 1)"> <dtml-call "REQUEST.set('myVar', myVar + 1)"> Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
participants (3)
-
Max M -
Tommy Johnson -
Vid B