Unlike class types, object types can only have static constructors.
program Produce; type TMyObject = object constructor Init; virtual; end; constructor TMyObject.Init; begin end; begin end.
The example tries to declare a virtual constructor, which does not really make sense for object types and is therefore illegal.
program Solve; type TMyObject = object constructor Init; end; constructor TMyObject.Init; begin end; begin end.
The solution is to either make the constructor static, or to use a new-style class type which can have a virtual constructor.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|