Richard Hensman wrote:

><cfif recordset.field eq 23> - doesn't work
><cfif "#recordset.field#" eq "23"> - does
>  
>
Thats quite frightening...
I just did the following as a test :

<cfset recordset.field = 23>

<cfif recordset.field eq 23>
    First<br>
</cfif>
<cfif "#recordset.field#" eq "23">
    Second
</cfif>

I get "First<br>Second" output, so both conditions are being met.

>The field is an integer, so the top comparison should match.
>
>This is just an example, there are more complicated ones too...  
>  
>
What version of CF are you running?  Have you tried code on another server?
Still.... What ever version... This is so simple I'm inclined to think 
that either there is something else going on that you're missing or your 
installation of CF is totally chuffed (technical term)

><cfset variables.thisvar = variables.thatvar> is the same as <cfset
>variables.thisvar = "#variables.thatvar#">
>
>I know this, in theory, I am just wondering about the deeper practical
>implementation of it.  I know in ASP Cint()-ing both sides of an if
>statement does sometimes fix problems, because a string with value "2"
>is not the same as an integer with value 2, which is not the same as a
>recordset.field.value that is a variant with a value of 2...
>  
>
Nah - its not that complicated.  CF is essentially an untyped language, 
although it is reasonably clever in its variable/value comparisons.

The only time I've ever had problems with comparisons is when I've 
stuffed something up myself.

I'm afraid I'm at a bit of a loss as to what to suggest.... Try the bit 
of code above and let me know what happens or if I'm missing something...

Stephen


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:876
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to