I think the docs meant to say you should not do this:
<cfreturn 1>
<cfreturn 2>
This will return 1. The only reason to not do this is because it's a
waste of time. As soon as the first cfreturn is encountered, the method
ends.
However, the code I sent in my other message would make sense... in one
condition return A, in another condition return B.
Some people will do...
<cfset returnCode = "a">
<cfif condition>
<cfset returnCode = "b">
</cfif>
<cfreturn returnCode>
But that just doesn't make sense to me.
========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)
Email : [EMAIL PROTECTED]
Blog : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus
"My ally is the Force, and a powerful ally it is." - Yoda
> -----Original Message-----
> From: jon hall [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 28, 2003 12:15 PM
> To: CF-Talk
> Subject: Re: CFRETURN has incorrect documentation
>
>
> multiple cfreturn's? Does it just return the second value or what?
>
> --
> jon
> mailto:[EMAIL PROTECTED]
>
> Monday, July 28, 2003, 2:05:12 PM, you wrote:
> BH> CFRETURN's documentation says that a maximum of one CFRETURN is
> BH> allowed per function. But I have code that does multiple
> CFRETURNs
> BH> and it works just fine. Let's not argue whether that's a good
> BH> programming practice, but do you think Macromedia will
> ever change
> BH> ColdFusion to disallow multiple CFRETURNs so that it
> agrees with the
> BH> documentation?
>
> BH>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4