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?
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?
On Tue, Apr 24, 2012 at 1:50 PM, Jari Ketola <ket...@gmail.com> wrote: > 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>
> 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?
I agree, and I have already modified the code, but is this a compability issue? The application that I loaded off riaforge (tested on ACF) didn't work out of the box!
| From: Jari Ketola [mailto:ket...@gmail.com] | Sent: Tuesday, April 24, 2012 13:50 | To: openbd@googlegroups.com | Cc: fraxi...@oxel.net | Subject: Re: test with empty query | | 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 | fraxi...@oxel.net
On Tue, Apr 24, 2012 at 5:48 AM, Hugo Ahlenius <fraxi...@oxel.net> wrote: > I agree, and I have already modified the code, but is this a compability > issue?