Object Oriented
From Pointui
Some basic object oriented capability is supported. It is been included mainly to allow for grouping of code into logical components rather than to provide comprehensive OO support.
- Classes can be defined which may optionally inherit from a parent class.
- Classes can have properties.
- Classes can have methods.
- All methods are assumed virtual, but without access to the parent implementation at this stage.
- Constructors and destructors are currently not supported – well they sort of are but are mainly for internal use at this stage.
Here is an example:
class A { int Property1, Property2; void Method1() { //class A version of Method1 } } class B : A { void Method1() { //class B version of Method1 } void Method2() { } }
In this example, class A is a simple class that contains two integer properties and a single method. Class B inherits from class A and replaces the Method1() behavior, and adds an additional method – Method2(). So the resulting class B complete definition incorporating the class A elements would look like this:
class B { int Property1, Property2; void Method1() { //class B version of Method1 } void Method2() { } }
