> I just got an error message on a page that is working on the
> server that is running 4.0. This is the message:
> "Error in expression:
>
> AdminID=0
>
> Invalid conditional expression. Perhaps you are using =
> instead of EQ or IS to compare values."
>
> I may just have been stupid when I set this up, but 4.0 had a
> lot of cfif problems that were fixed in 4.0.1 and I probably did
> this to get around one of them. It was very cranky about how
> values were compared in cfif statements. I was under the
> impression that I am supposed to compare integer values with = and
> text values with EQ or IS. I may have been wrong in that assumption.
You are wrong in that assumption. The equal sign is reserved for assignment;
CF only uses english-language comparison operators:
IS, EQ
IS NOT, NEQ
LESS THAN, LT
LTE
GREATER THAN
GTE
CONTAINS
DOES NOT CONTAIN
Now, as to why it worked before, but doesn't now.
Newer implementations of CF Server are pickier about what incorrect
statements they will allow. There are all kinds of things, for example, that
you could do in CF 3.x that stop working in 4.x. CF will continue moving in
that direction - the pickier the parser is, the less time CF will have to
spend figuring out what it needs to do. In the past, using an equals sign in
a comparison might work, but maybe not the way you'd expect it to. If we
look at the following statement:
CFIF x = 1
What exactly does this do? Well, it might be evaluated like this:
CFIF (x = 1)
In this case, you're doing an assignment, x = 1, then you're evaluating the
results of that assignment:
CFIF (the return value of successfully performing an assignment)
In short, you'd execute the assignment, and your CFIF would never fail. I'm
not sure that's what CF used to do, but I wouldn't be surprised.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.