The Raise Event operation can pass arguments to handlers that will handle the raised event.
The list of arguments, accessible from the Raise Event Arg: field, lets you enter the arguments you want to pass to the handler.
The passed arguments can be received in the handler when you create Parameter variables inside the handler. The passed arguments are entered into the handler’s parameters according to their order, so that the first argument is entered into the first parameter, etc.
If the corresponding handler has no parameters defined, the handler does not receive the passed argument values.
In the User Events section you will learn how to declare user event parameters for easier management of the logic.
Arguments Passed by Reference – Variables passed as arguments from a synchronous Raise Event operation, where Wait=Yes, are updated by any change in the value of the corresponding parameter of the handler. If the argument passed is an expression, no new value can be returned.
Arguments Passed by Value – Variables passed as arguments from an asynchronous Raise Event operation, where Wait=No, will not be updated by changes in the value of the handler parameter.
Arguments Passed to a Propagating Handler – Arguments passed to a handler that propagates the event are also passed to the next corresponding handler. If an argument is passed by a reference, such as an argument passed as a variable from a synchronous raise event operation, and the first handler updates it, then the next handler receives the updated value. If an argument is passed by a value, such as an argument passed as an expression or passed from an asynchronous raise event operation, the next handler always receives the original value of the argument passed by the Raise Event operation.
|
-
When the Wait property is set to No, arguments will always be passed by value and never by reference.
-
Even if the first handler does not have parameters defined to receive the arguments, the next handler can still receive the arguments. You do not have to define the parameters in a lower handler if you only need to receive the arguments in the next handler.
|
|