increment variable
Hello again, I think I've seen this subject on the list before but I'm having a hard time wording it right so as to find it in the archives. Is there a way, without PythonMethod & External Python Methods, to increment a variable (possibly a cookie value)? Something like this: <dtml-var "_['PresetCookie']=_['PresetCookie']+1"> or <dtml-var "_['PresetCookie']=_['PresetCookie']+_['product_cost']"> I've tried the above, to no avail. I get syntax errors as soon as I try to save the changes to the document. Thank you. -- ========================================================================== Mike Mikkelsen mikk@microbsys.com Micro Business Systems http://www.microbsys.com Fresno Linux Users Group http://linux.fresno.ca.us Linux: The OS people choose without $200,000,000 of persuasion
How about (untested) <dtml-call "REQUEST.set('PresetCookie',PresetCookie+1)"> HTH Phil phil@philh.org -----Original Message----- From: mikk@lx1.microbsys.com [mailto:mikk@lx1.microbsys.com]On Behalf Of Mike Mikkelsen Sent: 29 September 1999 22:29 To: zope@zope.org Subject: [Zope] increment variable Hello again, I think I've seen this subject on the list before but I'm having a hard time wording it right so as to find it in the archives. Is there a way, without PythonMethod & External Python Methods, to increment a variable (possibly a cookie value)? Something like this: <dtml-var "_['PresetCookie']=_['PresetCookie']+1"> or <dtml-var "_['PresetCookie']=_['PresetCookie']+_['product_cost']"> I've tried the above, to no avail. I get syntax errors as soon as I try to save the changes to the document. Thank you. -- ========================================================================== Mike Mikkelsen mikk@microbsys.com Micro Business Systems http://www.microbsys.com Fresno Linux Users Group http://linux.fresno.ca.us Linux: The OS people choose without $200,000,000 of persuasion _______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (Related lists - please, no cross posts or HTML encoding! To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Thanks for the reply. I get the following Zope error using the example from below: TypeError Illegal argument type for built-in operation. I also get this error with the following: <dtml-call "REQUEST.set('NewVariable',PresetCookie+1)"> Phil Harris wrote:
How about (untested)
<dtml-call "REQUEST.set('PresetCookie',PresetCookie+1)">
HTH
Phil phil@philh.org
-- ========================================================================== Mike Mikkelsen mikk@microbsys.com Micro Business Systems http://www.microbsys.com Fresno Linux Users Group http://linux.fresno.ca.us Linux: The OS people choose without $200,000,000 of persuasion
How about <dtml-call "REQUEST.set('PresetCookie',_.int(PresetCookie)+1)"> -----Original Message----- From: mikk@lx1.microbsys.com [mailto:mikk@lx1.microbsys.com]On Behalf Of Mike Mikkelsen Sent: 29 September 1999 23:30 To: zope@zope.org Subject: Re: [Zope] increment variable Thanks for the reply. I get the following Zope error using the example from below: TypeError Illegal argument type for built-in operation. I also get this error with the following: <dtml-call "REQUEST.set('NewVariable',PresetCookie+1)"> Phil Harris wrote:
How about (untested)
<dtml-call "REQUEST.set('PresetCookie',PresetCookie+1)">
HTH
Phil phil@philh.org
-- ========================================================================== Mike Mikkelsen mikk@microbsys.com Micro Business Systems http://www.microbsys.com Fresno Linux Users Group http://linux.fresno.ca.us Linux: The OS people choose without $200,000,000 of persuasion _______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (Related lists - please, no cross posts or HTML encoding! To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Woohoo!!!!!!! You da man, Phil!!!!! THANK YOU! (...doesn't take much to make me happy ;-) ) Is there a reference to these "_." functions? How about a _.dbl(whatever) or _.double(whatever) or _.float(whatever)? Are these _. functions even Zope functions, or are they Python? Nevermind... time to learn python. Buwahhhh ha ha ha ha ha ha!!!! A monster has been set loose! >8-)........ Phil Harris wrote:
How about
<dtml-call "REQUEST.set('PresetCookie',_.int(PresetCookie)+1)">
-- ========================================================================== Mike Mikkelsen mikk@microbsys.com Micro Business Systems http://www.microbsys.com Fresno Linux Users Group http://linux.fresno.ca.us Linux: The OS people choose without $200,000,000 of persuasion
Take a look at the Zope Quick Reference (my bible ;¬)) It's at http://zope.org/Members/ZQR HTH Phil phil@philh.org -----Original Message----- From: mikk@lx1.microbsys.com [mailto:mikk@lx1.microbsys.com]On Behalf Of Mike Mikkelsen Sent: 30 September 1999 00:03 To: zope@zope.org Subject: Re: [Zope] increment variable Woohoo!!!!!!! You da man, Phil!!!!! THANK YOU! (...doesn't take much to make me happy ;-) ) Is there a reference to these "_." functions? How about a _.dbl(whatever) or _.double(whatever) or _.float(whatever)? Are these _. functions even Zope functions, or are they Python? Nevermind... time to learn python. Buwahhhh ha ha ha ha ha ha!!!! A monster has been set loose! >8-)........ Phil Harris wrote:
How about
<dtml-call "REQUEST.set('PresetCookie',_.int(PresetCookie)+1)">
-- ========================================================================== Mike Mikkelsen mikk@microbsys.com Micro Business Systems http://www.microbsys.com Fresno Linux Users Group http://linux.fresno.ca.us Linux: The OS people choose without $200,000,000 of persuasion _______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (Related lists - please, no cross posts or HTML encoding! To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Mike Mikkelsen -
Phil Harris