Self
and Base
The object variables Self
and Base
are special in ViviFire.
Self
You use Self
to refer to the instance of the class that owns the block of code in which it is used.
It shows as an object reference, but you cannot change which object it references.
You can use Self
to pass the current object instance to other procedures that subsequently call methods on it.
Base
You use Base
to call methods and properties in the parent class from a child class.
This is necessary only when you overrode a procedure in your child class.
Without Base
, you will call the procedure in the child class, and not the one in the parent class.
@Open Class BaseClass
@Open Method Foo bar
End Method
End Class
Class DerivedClass Is BaseClass
@Override Method Foo bar
Base.Foo bar
End Method
End Class