<CFRETURN> Tag - ColdFusion


>> Return to ColdFusion Tag Index

The <CFRETURN> tag allows you ...



  <CFRETURN> Comments from Macromedia LiveDocsLiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a28.htm
Yes, cfreturn stops processing at the point you call it.

Yes, you can have several cfreturns within a cffunction.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a28.htm
Does CFRETURN stop processing the code within a CFFUNCTION, or does it keep executing the code until </CFFUNCTION>, and then return the value specified ?

If it exits immediately, this means that we could have several CFRETURNs within a CFFUNCTION block ?

Ex:

<CFIF xxxxx>
[...code...]
<CFRETURN ErrorMsg1>
<CFELSEIF yyyy>
[...code...]
<CFRETURN ErrorMsg2>
<CFELSE>
[...code...]
<CFRETURN NoErrMsg>
</CFIF>

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-a28.htm
This doesn't appear to be documented anywhere, but in building custom tags, I've found that <cfreturn> can be used to break out of an execution mode (start primarily), without causing the tag processing to be stopped (like <cfexit> seems to do).



[Top]


Recommended Books

[Top]

Web Sites

[Top]

Copyright © 2003- 2008, Orville Paul Chomer, All Rights Reserved