<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>ISCUSTOMFUNCTION</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">ISCUSTOMFUNCTION</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>
Determines whether a name represents a custom 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">Returns</span>
<p>
True, if <i>name</i> can be called as a custom function; False, otherwise.
</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>
Decision functions
</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">Function syntax</span><pre>IsCustomFunction(name)
</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">Parameters</span>
<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>
The IsCustomFunction function returns True for any function that can be called as a custom function, including functions defined using CFScript function declarations and cffunction tags, and functions that are ColdFusion component methods. For CFC methods, you must first instantiate the component.
</p>
<table>
  <tr valign="top">
    <td width="30"><strong>Note: </strong></td>
    <td>To prevent undefined variable exceptions, always precede IsCustomFunction with an IsDefined test, as shown in the example.</td>
  </tr>
</table>    </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;h3&gt;IsCustomFunction Example&lt;/h3&gt;
&lt;cfscript&gt;
function realUDF() {
   return 1;
}
&lt;/cfscript&gt;
&lt;cfset X = 1&gt;

&lt;!--- Example that fails existence test ---&gt;
&lt;cfif IsDefined(&quot;Foo&quot;) AND IsCustomFunction(Foo)&gt;
   Foo is a UDF.&lt;br&gt;
&lt;/cfif&gt;

&lt;!--- Example that passes existence test but fails IsCustomFunction ---&gt;
&lt;cfif IsDefined(&quot;X&quot;) AND IsCustomFunction(X)&gt;
   X is a UDF.&lt;br&gt;
&lt;/cfif&gt;

&lt;!--- Example that passes both tests---&gt;
&lt;cfif IsDefined(&quot;realUDF&quot;) AND IsCustomFunction(realUDF)&gt;
   realUDF is a function.&lt;br&gt;
&lt;/cfif&gt;

&lt;!--- Example using a CFC, defined in TestCFC.cfc---&gt;
&lt;cfobject component=&quot;TestCFC&quot; name=&quot;myTestCFCobject&quot;&gt;
&lt;CFIF IsDefined(&quot;myTestCFCobject.testFunc&quot;) AND 
      IsCustomFunction(myTestCFCobject.testFunc)&gt;
   myTestCFCobject.testFunc is a function.
&lt;/CFIF&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="NAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">NAME</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>


<p>Name of a custom function. Must not be in quotation marks. If not a defined variable or function name, ColdFusion generates an error.</p>

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

  </body>
</html>
