Hi all, I want to compare the result of a query (var1) with a variable (var2) as follows: <dtml-if expr="var1>var2"> <font = red> </dtml-if> Can anyone tell me the correct way of going about this? TIA, Micheál Healy
That should do it. If you are comparing integers, it might not be a bad idea to make sure they are integers. OTOH, it could just be a waste of time for your application. Stuff that lives in REQUEST comes to you as strings. <dtml-if expr="int(REQUEST.var1) > int(REQUEST.var2)"> <span style="color: red; background-color: transparent;">This, that and the other...</span> </dtml-if> Troy Micheál Healy wrote:
Hi all,
I want to compare the result of a query (var1) with a variable (var2) as follows:
<dtml-if expr="var1>var2"> <font = red> </dtml-if>
Can anyone tell me the correct way of going about this?
TIA,
Micheál Healy
The int() function probably won't work without a namespace. Try: <dtml-if expr="_.int(var1) > _.int(var2)"> HTH Dylan At 08:26 AM 10/21/2002 -0500, Troy Farrell wrote:
That should do it. If you are comparing integers, it might not be a bad idea to make sure they are integers. OTOH, it could just be a waste of time for your application. Stuff that lives in REQUEST comes to you as strings.
<dtml-if expr="int(REQUEST.var1) > int(REQUEST.var2)"> <span style="color: red; background-color: transparent;">This, that and the other...</span> </dtml-if>
Troy
Micheál Healy wrote:
Hi all,
I want to compare the result of a query (var1) with a variable (var2) as follows:
<dtml-if expr="var1>var2"> <font = red> </dtml-if>
Can anyone tell me the correct way of going about this?
TIA,
Micheál Healy
_______________________________________________ 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 )
participants (3)
-
Dylan Reinhardt -
Micheál Healy -
Troy Farrell