|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Strange problem with datatypes?
Sorry if the title is a bit vague. Don't know how else to describe this. For reference, this is CF5.
To make a long story short, this bit of code actually outputs "true". Code:
<cfif "00D96" EQ "00D40"> true <cfelse> false </cfif> On further investigation, it appears that "00D<number>" will equal any other "00D<number>" I've searched but nothing has come up. What's going on here? Is ColdFusion getting its datatypes confused? Does CF have typecasting? |
|
#2
|
|||
|
|||
|
It could easily be some kind of type casting error in CF 5. That version is something like five years old. The code runs correctly on CFMX 6, 6.1, and 7.0.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
Yeah. I had a friend test it on 6.1 as well.
Unfortunatly, I don't have a choice as to which version I'm using. You're probably right that it's a type casting issue. Cursed CF for being a loosely typed language. edit: It works properly when I use the compare() function. Looks like that's my solution. |
|
#4
|
|||
|
|||
|
CF's loose typing is actually a huge speed booster in most cases. And again, the problem doesn't affect any recent version. The type casting has improved greatly since the switch to Java.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Strange problem with datatypes? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|