If you are asking whether it is true or false, then it is true.  But if you ask what is value of that _expression_, then it is 20.  I think that is two different questions.  So you get two different answers.

Johnny

>Run this:
>
><cfif true and (4*5)>true<cfelse>false</cfif><br>
><cfif (4*5) and true>true<cfelse>false</cfif><br>
><cfif false and (4*5)>true<cfelse>false</cfif><br>
><cfif (4*5) and false>true<cfelse>false</cfif><br>
><br>
><cfoutput>#true and (4*5)#</cfoutput><br>
><cfoutput>#(4*5) and true#</cfoutput><br>
><cfoutput>#false and (4*5)#</cfoutput><br>
><cfoutput>#(4*5) and false#</cfoutput><br>
>
>Barney Boisvert wrote:
>
>> This is not a bug, it's just part of using a loosely typed language.
>> Non-zero values are true, and zero is false.  A short-circuited boolean
>> evaluation returns the value of the last _expression_ that is evaluated.
>>
>> Note, that whether the first test returns 'true' or '20', both are true
>> values, so it won't affect anything.  You can use 20 any place you use true
>> and it will behave the same way.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to