View comments | RSS feed

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>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


bobhead said on Jun 12, 2002 at 10:19 AM :
I think the usage and example are both wrong. The example code (pasted into a template does not work as described) nor does the example on macromedia.com. I think the correct syntax (as shown in the CF 5.0 doc) is:
isCustomFunction( name )
(without quotes).
The example in the CF 5.0 doc works correctly.
ctina said on Jul 19, 2002 at 2:51 PM :
Update from Macromedia, in response to bobhead:
You are correct; in isCustomFunction, the parameter does not take quotation marks. Use this syntax:
isCustomFunction(name)

The documentation will be updated. THhnks for your comment.

Christina Lamkin
CF documentation team

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt1127.htm