#Self and #Base in ViviFire

Describe

#Self

The #Self keyword provides a way to refer to the specific instance of the class that owns the block of code in which it is used. It resembles an object handle, except it cannot explicitly be assigned a different object. #Self is most useful for passing the current object instance to other objects, methods, etc. that require its services.

#Base

The #Base keyword provides a way to call methods in the base class of the subclass in which it is used. Specifically, it is useful to call the overridden method from within an Override Method.

Every subclass's constructor should invoke its base class's equivalent constructor using a New #Base statement. The following is an example.

Listing: Calling a base constructor
Class MyBaseClass
    Constructor foo, bar
    End Constructor
End Class

Class MySubclass Is MyBaseClass
    Constructor foo, bar
        New #Base, foo, bar
    End Constructor
End Class

See also