So I guess with all this talk I should just do this. <cfif userExists> Return object <cfelse> Return '' /> </cfif>
This way I can check to see if it is empty, or even return an empty object. It seems that there are things in CF that are designed to make it as OO as possible if you care try, but when it comes to the nitty gritty there are things that are not there that should be. Regards Andrew Scott Analyst Programmer CMS Transport Systems Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9699 7988 - Fax: 03 9699 7976 Quote: Dilbert's Words of Wisdom: Tell me what you need, and I'll tell you how to get along without it. ---------------------------------------------------------------------------- -------------------------- -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean Corfield Sent: Monday, 24 October 2005 7:02 AM To: [email protected] Subject: Re: [CFCDev] CFC return types On 10/23/05, Hal Helms <[EMAIL PROTECTED]> wrote: > I agree, Vince. I think exceptions should be for just that: exceptional > conditions. A person not having a spouse, a library book not having a > lendee, etc. are not exceptional conditions. Throwing an exception in such a > non-exceptional case is, IMHO, pretty dubious. Agreed, if the object not being present is expected then the code should use a test for the presence of the object before requesting it. Note that there actually are ways to use nulls in CFML but they're just not very clean at the moment... <cfset variables.foo = JavaCast("null","") /> <cfif not structKeyExists(variables,"foo")> variables.foo is null </cfif> -- Sean A Corfield -- http://corfield.org/ Got frameworks? "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). CFCDev is supported by New Atlanta, makers of BlueDragon http://www.newatlanta.com/products/bluedragon/index.cfm An archive of the CFCDev list is available at www.mail-archive.com/[email protected] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). CFCDev is supported by New Atlanta, makers of BlueDragon http://www.newatlanta.com/products/bluedragon/index.cfm An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
