There seems to be a difference in the outcome of <cfif myvar IS true> and <cfif
myvar>, when myvar is a number but neither 0 nor 1.
Is this a feature to be used, or a bug, or have i missed something?
Bert
ps save the code below as trueorfalse.cfm to see what i mean:
<cfparam name="myvar" default="2">
<cfoutput>
<b>#myvar#:</b>
<cfif myvar IS true>
myvar IS true
<cfelseif myvar IS false>
myvar IS false
<cfelse>
cfelse (i.e. NOT "myvar IS true" OR "myvar IS false")
</cfif>
<br>
<b>#myvar#:</b>
<cfif myvar>
myvar
<cfelseif NOT myvar>
NOT myvar
<cfelse>
cfelse (i.e. NOT "cfif myvar" OR "cfif NOT myvar")
</cfif>
<form action="trueorfalse.cfm" method="post">
<input type="text" name="myvar" value="#myvar#">
<input type="Submit">
</form>
</cfoutput>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists