In some scenarios, you're better off raising an exception than returning "null", but it doesn't work in all situations. Where you can't do it, you have to declare returntype="any", as you've discovered. For example a getSpouse() method of Person CFC should raise a UnmarriedException when called on an unmarried person, rather than returning null.
cheers, barneyb On 10/22/05, Andrew Scott <[EMAIL PROTECTED]> wrote: > > I have a situation where I want to return null, or an object in coldfusion > so far the only way I can do this is by not specifying a returntype. > > Is there any other method to decided whether the object was found or not. I > know I other languages by returning null signifies nothing was found, how > would this be translated in coldfusion mx 6.1? > > > Regards, > Andrew Scott > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 100 invites. ---------------------------------------------------------- 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]
