ColdFusion sure can lead to strange coding conventions. Sometimes it seems
you can throw just about anything at <cfif> and it will sort itself out. =)
I'm not a CF programmer myself, so I resort to "more conventional" methods.
isDefined() is your friend here.
<cfif isDefined("query.column")>
// do stuff
</cfif>
Can you guess what
<cfset myVar="true"/>
<cfoutput>
#myVar# is #isBoolean(myVar)#
</cfoutput>
outputs? My guess would have been "true is FALSE", but it seems things
aren't always so black and white. Or zero and one.
Jari
P.S. The correct answer is "true is YES". Now that's what I call an
enthusiastic boolean!
On Tuesday, April 24, 2012 1:18:51 PM UTC+3, Hugo Ahlenius wrote:
>
> Hi,
>
> I was working with an application now, and I noticed that it is doing
> tests:
>
> <cfif query.column>
> --- do something
> </cfif>
>
> If the query is empty (no rows), then this fails on OpenBD - I assume it
> returns false on ACF. Is this known/documented? Is this a compability issue
> to fix?
>
> Thanks,
> Hugo
>
> --
> Hugo Ahlenius
> [email protected]
>
>
--
online documentation: http://openbd.org/manual/
google+ hints/tips: https://plus.google.com/115990347459711259462
http://groups.google.com/group/openbd?hl=en