[Zope] If This AND This
Nils Kassube
lists@kassube.de
Fri, 1 Jun 2001 22:42:09 +0200
* 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