Func

Retrieves a reference to a function.

FunctionReference := Func(FunctionName)

Parameters

FunctionName

Type: String

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

Return Value

Type: Object

This function returns a reference to FunctionName; that is, a Func or Closure object. 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 an empty string.

If FunctionName is a nested function inside a function with free variables, a new Closure is created and returned. This has the same properties as a Func.

Remarks

The returned object can be used to call the function or retrieve information such as the minimum and maximum number of parameters.

Related

Function References, Func Object, Closures, IsFunc

Examples

#1

; Retrieve a reference to the function named "StrLen".
fn := Func("StrLen")

; Display information about the function.
MsgBox fn.Name "() is " (fn.IsBuiltIn ? "built-in." : "user-defined.")