TatScripterEventBroker.UnsetEvent Method
Unsets an event handler for a Delphi object's event which was previously set with SetEvent.
Syntax
Unit: atScript
function TatScripterEventBroker.UnsetEvent(AInstance: TObject; APropName: string; ARoutineName: string; AScripter: TatCustomScripter = nil): Boolean;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| AInstance | TObject | Contains the instance of the object for which the event will be unset | |
| APropName | string | Contains the name of the event to be unset, for example, 'OnClick' | |
| ARoutineName | string | Must be empty if you want to remove the last event set. If you want to remove an event that was not the last one set, then specify the script routine name to be removed | |
| AScripter | TatCustomScripter | Optional: Default value is nil Contains the scripter object which holds the script routine to be removed as an event handler Unset event returns true if the event handler did exist and was removed. It returns false if for example the routine name didn't exist, or the object event was just not previously set with SetEvent. |