Represents a user-defined or built-in function which can be called by the script. Func returns an object of this type.
For information about other objects which can be called like functions, see Function Objects.
A reference to a Func object is also known as a function reference. To retrieve a function reference, use the Func function as in the following example:
; 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.")
Calls the function.
Func.Call(Param1, Param2, ...) ; Requires [v1.1.19+] Func.(Param1, Param2, ...) ; Old form - deprecated
[v1.1.07+]: %Func%()
can be used to call a function by name or reference, or to call an object which implements the __Call meta-function. This should be used instead of Func.()
wherever possible.
Binds parameters to the function and returns a BoundFunc object.
BoundFunc := Func.Bind(Param1, Param2, ...)
For details and examples, see BoundFunc object.
Determines whether a parameter is ByRef.
Boolean := Func.IsByRef(ParamIndex)
Returns an empty string if the function is built-in or ParamIndex is invalid; otherwise, a boolean value indicating whether the parameter is ByRef.
Determines whether a parameter is optional.
Boolean := Func.IsOptional(ParamIndex)
Returns an empty string if ParamIndex is invalid; otherwise, a boolean value indicating whether the parameter is optional.
Parameters do not need to be formally declared if the function is variadic. Built-in functions are supported.
Returns the function's name.
FunctionName := Func.Name
Returns the number of required parameters.
ParamCount := Func.MinParams
Returns the number of formally-declared parameters for a user-defined function or maximum parameters for a built-in function.
ParamCount := Func.MaxParams
If the function is variadic, ParamCount indicates the maximum number of parameters which can be accepted by the function without overflowing into the "variadic*" parameter.