IsFunc

Returns a non-zero number if the specified function is visible within the current scope.

MinParamsPlus1 := IsFunc(FunctionName)

Parameters

FunctionName

Type: String

The name of the function whose minimum number of parameters is retrieved. FunctionName must exist explicitly in the script, or be built-in.

Return Value

Type: Integer

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.

Remarks

An exception is thrown if FunctionName is an object. To instead determine whether an object appears to be callable, use one of the following:

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.

Related

Dynamically Calling a Function, Function References, Func Object, Func, A_ThisFunc

Examples

#1

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."