Event Statement

Defines the signature for an event handler.

Syntax

Event eventName [ parameterList ]

Parts

eventName
Required
parameterList
Optional

Remarks

The name is a type that can be used in a parameter passed to a constructor or method. Such procedures must be passed the name of a Sub that has a signature that matches that specified by parameterList.

Examples

Listing 1: In a system library
Event EWindowClose(#win As Window)
' ...
Dim closer as EWindowClose
' ...
Method WhenClose(evt As EWindowClose)
    closer = evt
End Method
Listing 2: In the user module
' Set the window's close event handler
#w.WhenClose = Quit

Sub Quit Does EWindowClose
    ' The "Does" clause is like having
    ' Sub Quit(#win As Window)
    #win.Close()
End Sub

See also