Returns a non-zero number if the specified function is visible within the current scope.
MinParamsPlus1 := IsFunc(FunctionName)
The name of the function whose minimum number of parameters is retrieved. FunctionName must exist explicitly in the script, or be built-in.
This function returns one plus the minimum number of parameters (e.g. 1 for a function that requires zero parameters, 2 for a function that requires 1 parameter, etc.). If FunctionName is not built-in and does not exist explicitly in the script (by means such as #Include or a non-dynamic call to a library function), it returns 0.
An exception is thrown if FunctionName is an object. To instead determine whether an object appears to be callable, use one of the following:
Value.HasMethod("Call")works with all AutoHotkey values and objects by default, but allows HasMethod to be overridden for some objects or classes. For COM objects, this will typically fail (throw an exception or produce the wrong result) unless the COM object is actually an AutoHotkey object from another process.
HasMethod(Value, "Call")works with all AutoHotkey values and objects and cannot be overridden, but will return false if the presence of a Call method cannot be determined (i.e. because Value is a COM object).
The search includes all functions visible to the line from which IsFunc was called. For instance, it includes functions which are directly nested inside the current function.
Dynamically Calling a Function, Function References, Func Object, Func, A_ThisFunc
count := IsFunc("RegExReplace") ; Any function name can used here. if count MsgBox "This function exists and has " count-1 " mandatory parameters." else MsgBox "This function does not exist."