Destructor Statement

Defines the code to execute when an instance of a class is destroyed.

Syntax

Destructor
    [ statements ]
End [ Destructor ]

Parts

statements
Optional
End
Completes the Destructor statement. Alternatively, you can use End Destructor.

Details

Typically, a destructor is needed to free a system resource, such as an Internet socket, for example.

Only a single destructor is permitted within a class. The destructor must be placed after any and every Constructor and before any Function, Method, or Sub.

Examples

See also