<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1516" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I would like to declare a polymorph class. The
class has several properties and it's the read and write specifiers that I want
to be virtual abstract. So derived classes override the read and write
specifiers. The problem however is that I get an EAbstractError. The
property is still considered to be abstract according to the compiler. So what
did I wrong? I have added an example below.</FONT></DIV>
<DIV><FONT face=Arial size=2>Is it perhaps not allowed to use this construct?
What would then be the best way?</FONT></DIV>
<DIV><FONT face=Arial size=2>Darius</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><<example>></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>unit MyTest;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>{$mode objfpc}{$H+}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>interface</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>uses<BR> Classes, ComCtrls,
SysUtils;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>type<BR> TCustomClass = class<BR>
private<BR></FONT><FONT face=Arial size=2> //virtual
mehods<BR> function GetMyProperty: string; virtual;
abstract;<BR> procedure SetMyProperty(Value: string); virtual;
abstract;<BR> published</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> property MyProperty: string Read
GetMyProperty Write SetMyProperty;<BR> end;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> TMyClass = class(TCustomClass)<BR>
private<BR> FMyProperty: string;<BR></FONT></DIV>
<DIV><FONT face=Arial size=2> function GetMyProperty: string;
overload;<BR> procedure SetMyProperty(Value: string);
overload;<BR> published<BR> property
MyProperty;<BR> end;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>implementation</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>function TMyClass .GetMyProperty:
string;<BR>begin<BR> Result := FMyProperty;<BR>end;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>procedure TMyClass .SetMyProperty(Value:
string);<BR>begin<BR> if Value = FMyProperty then<BR>
exit;<BR> <BR> FMyProperty :=
Value;<BR>end;</FONT></DIV>
<DIV><FONT face=Arial size=2>end.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT></BODY></HTML>