Delegate.Invoke
From Xojo Documentation
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site! |
Method
Delegate.Invoke([ParamArray parameter1 As Type, parameterN As Type]) As Type
Supported for all project types and targets.
Supported for all project types and targets.
Call the method pointed by the delegate. You must pass the same parameters as the method's ones and, if the method returns a value, you must use the return value as well.
Sample Code
If you defined a delegate as:
then you must use Invoke with the same parameters' type, as in:
Var d As myDelegateMethod
// <— Set d as your code requires
d.Invoke(1, 10, "An example string") // Values are indicative
// <— Set d as your code requires
d.Invoke(1, 10, "An example string") // Values are indicative
By contrast, if the Delegate is set to return a value as in:
then you must use the value returned by Invoke, as in: