i've been told (by someone much smarter than me) -not- to use implicit boolean conversion.
yes, in CF <cfif recordcount></cfif> will work (where 0 evaluates to false and any other number evaluates to true)...but what you really mean is: <cfif recordcount GT 0></cfif> you're looking to see if the recordcount is greater than a specific number. now, to be perfectly blunt, i can't tell you if it's for performance reasons or just "good practice"...but the person who told me this was Sean Corfield, and he's just got a -tad- more experience than I do when it comes to programming...so I tend to trust what he says (except i'm not falling for that "pull my finger" thing again). bottom line is, according to what I consider to be a reputable source...avoid implicit boolean conversion. (now, this is normally the part of a thread where stuff starts flying...so suit up everybody) :) On 9/13/06, Greg Luce <[EMAIL PROTECTED]> wrote: > Is it a good practice though? I know alot of people do it, but it just seems > wrong to me to be evaluating a number as boolean. > > Greg > > On 9/13/06, Claude Schneegans <[EMAIL PROTECTED]> wrote: > > > > >>It is NOT the same as saying, "as long as there is *one* record > > returned, true". > > > > Right, and it is also the same as saying "as long as there is *at least > > one* record returned, true". > > > > -- > > _______________________________________ > > REUSE CODE! Use custom tags; > > See http://www.contentbox.com/claude/customtags/tagstore.cfm > > (Please send any spam to this address: [EMAIL PROTECTED]) > > Thanks. > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253027 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

