Re: anybody see this before?

2009-01-09 Thread Jason Fisher
@Peter, I agree. Implicit or not, I find no issue with assuming that zero is false and any other value is true. That's been true in every DB I've used, whether the true is 'true' or '1' or '-1', the false is always '0' and my code is generally single use at any rate.

Re: anybody see this before?

2009-01-09 Thread Ben Nadel
RE: Barney, I disagree. I find implicit boolean conversions to be cleaner and easier to read (and are a feature of the language). But, furthermore, the implicit boolean conversion says even more about the statement than any comparision. If you see: this implies that there is a strict set

RE: anybody see this before?

2009-01-09 Thread Dawson, Michael
; tends to add a bit more explanation as to the intent of the code. However, it does add a few keystrokes. Mike -Original Message- From: Justin Scott [mailto:jscott-li...@gravityfree.com] Sent: Friday, January 09, 2009 2:19 PM To: cf-talk Subject: Re: anybody see this before? Barney Boisve

Re: anybody see this before?

2009-01-09 Thread Justin Scott
Barney Boisvert wrote: > Don't do that. What's happening is that the number > (isthere.recordcount) is being implicitly converted to a boolean for > the CFIF to process. Implicit conversion where the destination type > is something besides String is almost always the devil, end even if > it's Str

Re: anybody see this before?

2009-01-09 Thread Judah McAuley
And I'll chime in on Peter's side. I like boolean shortcut evaluation and consider it in the same class as well known shortcuts for things like autoincrement operator (i++). I can understand those that argue for explicit comparisons and there is certainly nothing wrong with it. But yeah, its just a

Re: anybody see this before?

2009-01-09 Thread Dave Watts
> There are functions where implicit conversion shouldn't be used: > DateCompare(), Max(), etc - those ones should be compared against the > expected value. > > But when the boolean conversion is known and unambigious - Query.RecordCount, > Len(), ArrayLen(), find(), etc - it is perfectly accept

Re: anybody see this before?

2009-01-09 Thread Peter Boughton
>"isthere" would be a variable reference to a query object with that name. Also, it is probably worth pointing out that "isthere" is an awful name to use for a query variable, and it should be changed to something more meaningful. (Though without seeing the original code it's not possible to know

Re: anybody see this before?

2009-01-09 Thread Peter Boughton
Yes, I do it, and disagree with Barney on implicit conversion always being evil. There are functions where implicit conversion shouldn't be used: DateCompare(), Max(), etc - those ones should be compared against the expected value. But when the boolean conversion is known and unambigious - Query

RE: anybody see this before?

2009-01-09 Thread mark
Duh. Missed that. There sure is a query named isthere. I thought isthere.recordcount was a function of some kind. -Original Message- From: Kris Jones [mailto:kris.jon...@verizon.net] Sent: Friday, January 09, 2009 2:58 PM To: cf-talk Subject: Re: anybody see this before? "is

Re: anybody see this before?

2009-01-09 Thread Kris Jones
"isthere" would be a variable reference to a query object with that name. "recordcount" is an attribute of a query object. isthere.recordcount would evaluate to a numeric of 0 or greater. If 0, it would evaluate in a boolean to false. Otherwise it would evaluate as true. No mystery here. Or am I ju

Re: anybody see this before?

2009-01-09 Thread Barney Boisvert
Don't do that. What's happening is that the number (isthere.recordcount) is being implicitly converted to a boolean for the CFIF to process. Implicit conversion where the destination type is something besides String is almost always the devil, end even if it's String it's still the devil sometime

anybody see this before?

2009-01-09 Thread mark
Working with some old code and found this.can't seem to find a reference via adobe.com or google or books. Is it old or am I just missing something. It does work. Seems a clean way to check.does anyone use this? Mark ~~