Ok, I've looked for this in documentation, but couln't find it. Also, I have tried a number of variing syntaxes, but to no avail. What I'm trying to do is code a DTML if statement that tests two conditions: <dtml-if this && that> Do this </dtml-if> Actually, I want to do this in an <dtml-unless>, so I guess whatever the syntax is, it will be the same for both (if's and unless) Anyone out there that knows this syntax? Thanks in advance, Tommy
Scratch that question. The one thing I didn't try WORKED! If anyone is interested, use & instead of && That's it! And if you're continuing to wonder, use | instead of || for OR. Now, I do have another question. Suppose you have a page running DTML, but want it to abort processing halfway through the page. Maybe a <dtml-unless> finds something and you want to abort processing any code below that <dtml-unless> block. How would you do that? Thanks in advance, Tommy -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Tommy Johnson Sent: Friday, May 25, 2001 5:59 PM To: Zope List Subject: [Zope] If This AND This Ok, I've looked for this in documentation, but couln't find it. Also, I have tried a number of variing syntaxes, but to no avail. What I'm trying to do is code a DTML if statement that tests two conditions: <dtml-if this && that> Do this </dtml-if> Actually, I want to do this in an <dtml-unless>, so I guess whatever the syntax is, it will be the same for both (if's and unless) Anyone out there that knows this syntax? Thanks in advance, Tommy
* Tommy Johnson <tommy@7x.com> [2001-05-26 04:21]:
Scratch that question. The one thing I didn't try WORKED! If anyone is interested, use & instead of &&
'&' is a bitwise and. 1 & 2 = 0 'and' is a logical and. 1 and 2 = 2 (which is equivalent to true in Python)
That's it! And if you're continuing to wonder, use | instead of || for OR.
That's bitwise or. You probably want to use 'or'. Well, it's easier to read, too...
Now, I do have another question. Suppose you have a page running DTML, but want it to abort processing halfway through the page. Maybe a <dtml-unless> finds something and you want to abort processing any code below that <dtml-unless> block. How would you do that?
It depends. One way: <dtml-unless something_found> <dtml-raise NotFound> Sorry, web page not found </dtml-raise> </dtml-unless> Cheers, Nils
participants (2)
-
Nils Kassube -
Tommy Johnson