[ic] IF comparison question

Steve Graham interchange-users@interchange.redhat.com
Sat May 11 22:54:01 2002



>From: René Hertell <rene@hertell.com>
>Reply-To: interchange-users@interchange.redhat.com
>To: <interchange-users@interchange.redhat.com>
>Subject: RE: [ic] IF comparison question
>Date: Sun, 12 May 2002 05:15:38 +0300
>
> > I see it too, it must be a typo. If you want, post a note, via the "Add
> > note" at the bottom of the page.
> >
> >     ==  numeric equivalence
> >     eq  string equivalence
> >     >   numeric greater-than
> >     gt  string greater-than
> >     <   numeric less-than
> >     lt  string less-than
> >     !=  numeric non-equivalence
> >     ne  string equivalence    ## should be "string non-equivalence"
> >
> >
> > I have seen that page a hunderd times, and never noticed it :)
>
>I also forgot to mention that those two codes displays the same result...
>
>René

I've seen some similar results using if compares - I would suggest using the 
scratch-=> like below (if applicable)

This works for me The code below if from my flypage , I only show Suggested 
list price if we are selling at a discount:

[tmp tp1][price code="[item-code]" quantity="1" noformat=1][/tmp]
[tmp tp2][item-field listprice][/tmp]
[if explicit]
[condition]
  $Scratch->{tp1} < $Scratch->{tp2}
[/condition]
<tr><td colspan="2"><font size="-2">Suggested Price: [currency][item-field 
listprice][/currency]</font></td></tr>
[/if]

I found the if explicit to be less confusing, and make sure your are using 
the proper compare for the data types. I'm new to Perl, but you don't get 
the expected results when you are comparing a string to a numeric.

-Steve


>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com