evaluated portion of the _expression_. In the first, both need evaluation, so
we return 3, the second one. If the second, only the first needs evaluation
(becase we know the _expression_ can't be true if either part is false), so
false is returned.
That's just a guess though. The moral of the story, of course, is that you
should never let CF implicitly change the type of values. Always do the
conversion explicitly, and you'll never be surprised.
Cheers,
barneyb
> -----Original Message-----
> From: Scott Brady [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 11, 2004 3:26 PM
> To: CF-Talk
> Subject: Boolean Inconsistency
>
> I was taking a practice exam for the MX Certification and one
> of the questions sparked some confusion with a colleague.
>
> Basically, here's the confusion:
>
> This code: <cfoutput>#(True AND 3)#</cfoutput> displays "3"
> This code: <cfoutput>#(False AND 3)#</cfoutput> displays "False"
>
> Now, I can accept the fact that CF handles the first line as
> multiplication and converts True to 1 (so 1 * 3 = 3).
> However, if that's the case, shouldn't the second line
> convert False to 0 and output 0 (0 * 3 = 0)?
>
> Does anyone know the rationale for this? Or could it be a bug?
>
> Scott
>
> ---------------------------
> Scott Brady
> http://www.scottbrady.net/
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

