IsCustomFunction

Description

Determines whether a function be called as a custom function. Displays information about a user-defined function.

Return value

True, if name can be called as a custom function; False, otherwise.

Category

Decision functions

Syntax

IsCustomFunction("name") 

Parameters

Parameter Description
name
Name of a custom function, between quotation marks.

Usage

The following example generates the following output:

realUDF is a function.

Example

<h3>IsCustomFunction</h3>
<cfscript>
function realUDF() {
  return 1;
}
</cfscript>
<CFSET X = 1>
<!--- example that  fails completely --->
<CFIF IsDefined("Foo") AND IsCustomFunction("Foo")>
  Foo is a UDF.<br>
</CFIF>

<!--- Example that passes, for X, but fails on IsCustomFunction --->
<CFIF IsDefined("X") AND IsCustomFunction("X")>
  X is a UDF.<br>
</CFIF>
<!--- Example that passes --->
<CFIF IsDefined("realUDF") AND IsCustomFunction("realUDF")>
  realUDF is a function.<br>
</CFIF>

Comments