[ic] Numeric comparison with IF
Vagel
interchange-users@lists.akopia.com
Mon May 28 18:28:00 2001
This is a multi-part message in MIME format.
------=_NextPart_000_0009_01C0E76D.B0544C60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello everyone,
Sorry to bother you with an IF problem again, but i really tried a lot =
before writing to you... :-\
The problem that i have is with 'if' and numeric comparison in =
Interchange V4.6.1.
After having searched in the mail list i used some examples that i found =
on string comparisons but this doesn't gives me the result that i'would =
like.
With the following code i'm trying to compare 2 numeric fileds : =
'price_retail' and 'price'. When 'price_retail' is greater than 'price', =
i would like to display a message.
This comparison works with '=3D' but not with '>'...
Can anyone give me some info on what i'm missing?
----------------- start of snipped code ------------------
[if explicit]
[condition]
$price_ret =3D '[value loop-price_retail]';
$price_to_pay =3D '[value loop-price]';
return 1 if $price_ret > $price_to_pay;
return 0;
[/condition]
message to display
[/if]
------------------ end of snipped code ------------------
Thank you in advance
Cheers
Vagel
------=_NextPart_000_0009_01C0E76D.B0544C60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello everyone,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Sorry to bother you with an IF problem =
again,=20
but i really tried a lot before writing to you... :-\</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The problem that i have is with <FONT =
face=3DArial=20
size=3D2>'if' and numeric comparison in Interchange V4.6.1.</FONT>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>After having searched in the mail list =
i used some=20
examples that i found on string comparisons but this doesn't gives me =
the result=20
that i'would like.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>With the following code i'm trying to =
compare 2=20
numeric fileds : 'price_retail' and 'price'. When 'price_retail' is =
greater than=20
'price', i would like to display a message.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This comparison works with '=3D' but =
not with=20
'>'...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone give me some info on what =
i'm=20
missing?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>----------------- start of snipped code =
------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[if=20
explicit]<BR> =20
[condition]<BR> &nbs=
p; =20
$price_ret =3D '[value=20
loop-price_retail]';<BR> &=
nbsp; =20
$price_to_pay =3D '[value=20
loop-price]';<BR> &n=
bsp; =20
return 1 if $price_ret >=20
$price_to_pay;<BR> &=
nbsp; =20
return 0;<BR> =20
[/condition]<BR> =
message=20
to display</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>[/if]<BR></FONT><FONT face=3DArial=20
size=3D2>------------------ end of snipped code =
------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you in advance</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Cheers</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Vagel</DIV></FONT></BODY></HTML>
------=_NextPart_000_0009_01C0E76D.B0544C60--