Raymond,

I use the method that you list below that "doesn't make sense to me."

This is a hold over (for me anyway) of my early programming days. [Remember
when BASIC (not visual) was the learning language of choice! ;) ]

I was always taught that it was poor programming to break out of code and
leave it hanging.  That's the same reason (in my opinion) that many
programmers hated GOTO.

Steve


-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2003 2:21 PM
To: CF-Talk
Subject: RE: CFRETURN has incorrect documentation


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

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to