Determines whether a name represents a custom function.
True, if name can be called as a custom function; False, otherwise.
IsCustomFunction(name)
Parameter |
Description |
---|---|
name |
Name of a custom function. Must not be in quotation marks. If not a defined variable or function name, ColdFusion generates an error. |
The IsCustomFunction function returns True for any function that can be called as a custom function, including functions defined using CFScript function declarations, CFScript function expressions, cffunction tags, and functions that are ColdFusion component methods. For CFC methods, first instantiate the component.
Note: To prevent undefined variable exceptions, always precede IsCustomFunction with an IsDefined test, as shown in the example.
For functions defined using function expressions, use isClosure().
<cfscript> // CustomFunction function2 = function (sum) {}; writeoutput("Is it a customFunction: " & isCustomFunction(function2)); </cfscript>
Output
Is it a customFunction: YES
Sign in to your account