ISCUSTOMFUNCTION | |||
Description
Determines whether a name represents a custom function. |
|||
Returns
True, if name can be called as a custom function; False, otherwise. |
|||
Category
Decision functions |
|||
Function syntaxIsCustomFunction(name) |
|||
Parameters
|
|||
Usage
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.
|
|||
Example<h3>IsCustomFunction Example</h3> <cfscript> function realUDF() { return 1; } </cfscript> <cfset X = 1> <!--- Example that fails existence test ---> <cfif IsDefined("Foo") AND IsCustomFunction(Foo)> Foo is a UDF.<br> </cfif> <!--- Example that passes existence test but fails IsCustomFunction ---> <cfif IsDefined("X") AND IsCustomFunction(X)> X is a UDF.<br> </cfif> <!--- Example that passes both tests---> <cfif IsDefined("realUDF") AND IsCustomFunction(realUDF)> realUDF is a function.<br> </cfif> <!--- Example using a CFC, defined in TestCFC.cfc---> <cfobject component="TestCFC" name="myTestCFCobject"> <CFIF IsDefined("myTestCFCobject.testFunc") AND IsCustomFunction(myTestCFCobject.testFunc)> myTestCFCobject.testFunc is a function. </CFIF> |
NAME | |