<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]

