[Zope] dtml-if var1 > var2

Troy Farrell troy@entheossoft.com
Mon, 21 Oct 2002 08:26:02 -0500


That should do it.  If you are comparing integers, it might not be a bad=20
idea to make sure they are integers.  OTOH, it could just be a waste of=20
time for your application.  Stuff that lives in REQUEST comes to you as=20
strings.

<dtml-if expr=3D"int(REQUEST.var1) > int(REQUEST.var2)">
   <span style=3D"color: red; background-color: transparent;">This, that=20
and the other...</span>
</dtml-if>

Troy

Miche=E1l Healy wrote:
> Hi all,
> =20
> I want to compare the result of a query (var1) with a variable (var2) a=
s=20
> follows:
> =20
> <dtml-if expr=3D"var1>var2">
>  <font =3D red>
> </dtml-if>
> =20
> Can anyone tell me the correct way of going about this?
> =20
> TIA,
> =20
> Miche=E1l Healy