Didelphodon posted in the german forum a oop-pre-compiler which allows you to write code like this:
Code: Select all
Class MyClass1
attribute1.l
Method setAttribute1(value.l)
*this\attribute1 = value
EndMethod
Method.l getAttribute1()
MethodReturn *this\attribute1
EndMethod
EndClass
Class MyClass2 Extends MyClass1
attribute2.l
Method setAttribute2(value.l)
*this\attribute2 = value
EndMethod
Method.l getAttribute2()
MethodReturn *this\attribute2
EndMethod
EndClass
NewObject *obj.MyClass2
*obj\setAttribute1(1)
*obj\setAttribute2(2)
Debug Str(*obj\getAttribute1()) + " / " + Str(*obj\getAttribute2())
*obj\destruct()
End
The site is in german, but the precompiler works very good. If there would be some good feedback on the forum or guestbook of this site, Didelphodon may extend this much more. He is paused in the moment, cause of some illness but will keep on working on this in future (i hope so).
The best thing on a way like this is, that everybody can choose if he wants to use oop or not. If it was possible to use this as an addin in the pb-ide, everyone would be happy, or not?
Kukulkan