Name

IsCustomFunction

Synopsis

                  
                  IsCustomFunction( )

Returns true if the specified Name is that of a user-defined function.

The following example uses IsCustomFunction( ) to determine whether Mean is a user-defined function. The IsDefined( ) function makes sure the name exists before testing it with IsCustomFunction( ). If you attempt to evaluate a name that doesn’t exist with IsCustomFunction( ), ColdFusion throws an error.

<cfscript>
if(IsDefined('Mean') and IsCustomFunction(Mean)){
   WriteOutput("Mean is a custom function!");
   }
else{
   WriteOutput("Mean is not a custom function!");
   }
</cfscript>

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.