<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFRETURN</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFRETURN</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Returns result values from a component method. Contains an expression returned as result of the function.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Return value</span>
<p>
An expression; the result of the function from which this tag is called.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Extensibility tags
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">Syntax</span><pre>&lt;cfreturn 
   expr&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
cfargument, cfcomponent, cffunction, cfinvoke, cfinvokeargument, cfobject, cfproperty; "Creating reports with the ColdFusion&#160;MX&#160;7 reporting" in Chapter&#160;32, "Creating Reports for Printing," in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">History</span>
<p>
ColdFusion&#160;MX: Added this tag.
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
This tag is equivalent to a return statement within a cfscript tag. It accepts one return variable argument. To return more than one value, populate a structure with name-value-pairs, and return the structure with this tag.
</p>

<p>
To access the result value from this tag, you use the variable scope that is the value of the cfinvoke tag returnVariable attribute.
</p>

<p>
You can code a maximum of one cfreturn tag within a function.
</p>

<p>
For example code, see Chapter&#160;10, "Building and Using ColdFusion Components" in ColdFusion MX Developer's Guide.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;cfcomponent&gt;
   &lt;cffunction name=&quot;getEmp&quot;&gt;
       &lt;cfquery name=&quot;empQuery&quot; datasource=&quot;ExampleApps&quot; &gt;
          SELECT FIRSTNAME, LASTNAME, EMAIL
          FROM tblEmployees
       &lt;/cfquery&gt;
       &lt;cfreturn empQuery&gt;
   &lt;/cffunction&gt;
   &lt;cffunction name=&quot;getDept&quot;&gt;
      &lt;cfquery name=&quot;deptQuery&quot; datasource=&quot;ExampleApps&quot; &gt;
          SELECT *
          FROM tblDepartments
       &lt;/cfquery&gt;
       &lt;cfreturn deptQuery&gt;
   &lt;/cffunction&gt;
&lt;/cfcomponent&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="EXPR">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">EXPR</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Required</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>Function result; value of any type.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
