I have some problems with <dtml-if> comand. It's possible to insert the following expression: <dtml-if "OUTPUT == 'PROENG' and 'MATRIX'"> OK </dtml-if> Is it right? Thanks in advance
Alessandra Pessolano wrote:
I have some problems with <dtml-if> comand. It's possible to insert the following expression: <dtml-if "OUTPUT == 'PROENG' and 'MATRIX'"> OK </dtml-if> Is it right? Thanks in advance
_______________________________________________ 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 )
You'd better write <dtml-if "OUTPUT == 'PROENG' and OUTPUT == 'MATRIX'"> OK </dtml-if> P.-J.
Pierre-Julien GRIZEL wrote:
Alessandra Pessolano wrote:
I have some problems with <dtml-if> comand. It's possible to insert the following expression: <dtml-if "OUTPUT == 'PROENG' and 'MATRIX'"> OK </dtml-if>
if you mean and <dtml-if "(OUTPUT == 'PROENG') and 'MATRIX'"> then it is equivalent to <dtml-if "OUTPUT='PROENG'"> if OTOH you mean and <dtml-if "OUTPUT == ('PROENG' and 'MATRIX')"> it is same as <dtml-if "OUTPUT=='MATRIX'"> which one did you mean ? ---------------- Hannu
On Wed, 15 Mar 2000, Pierre-Julien GRIZEL wrote:
<dtml-if "OUTPUT == 'PROENG' and OUTPUT == 'MATRIX'">
This will *always* be FALSE! Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
Alessandra Pessolano wrote:
I have some problems with <dtml-if> comand. It's possible to insert the following expression: <dtml-if "OUTPUT == 'PROENG' and 'MATRIX'"> OK </dtml-if> Is it right?
Well, it's syntactically correct. Whether or not it does what you want it to do we can't tell because you didn't say what you want to do. The expression "'PROENG' and 'MATRIX'" will _allways_ return 'MATRIX'. So 'OK' will only be rendered if OUTPUT == 'MATRIX'. In fact, this: <dtml-if "OUTPUT == 'MATRIX'"> OK <dtml-if> does exactly the same things as your code. -Michel
participants (5)
-
Alessandra Pessolano -
Hannu Krosing -
Michel Pelletier -
Oleg Broytmann -
Pierre-Julien GRIZEL