CFLib.org – Common Function Library Project

IsFunction(name)

Last updated September 26, 2001

author

Raymond Camden

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
This UDF checks to see if a particular string is a BIF (built in function) or UDF (user defined function).

Return Values:
Returns a boolean.

Example:

<CFSET GoodBIF = "arraylen">
<CFSET BadBIF = "victor">
<CFSET GoodUDF = "IsFunction">
<CFSET BadUDF = "newman">
<CFOUTPUT>
Is #GoodBIF# a function? #IsFunction(GoodBIF)#<BR>
Is #BadBIF# a function? #IsFunction(BadBIF)#<BR>
Is #GoodUDF# a function? #IsFunction(GoodUDF)#<BR>
Is #BadUDF# a function? #IsFunction(BadUDF)#<BR>
</CFOUTPUT>

Parameters:

Name Description Required
name The name to check. Yes

Full UDF Source:

/**
 * Returns true if the function is a BIF (built in function) or UDF (user defined function).
 * 
 * @param name 	 The name to check. 
 * @return Returns a boolean. 
 * @author Raymond Camden (ray@camdenfamily.com) 
 * @version 1, September 26, 2001 
 */
function IsFunction(str) {
 if(ListFindNoCase(StructKeyList(GetFunctionList()),str)) return 1;
 if(IsDefined(str) AND Evaluate("IsCustomFunction(#str#)")) return 1;
 return 0;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson