ich habe eben das hier implementiert:
Delphi-Quellcode:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
type TBaseClass = class
private
B: Boolean;
public
function ReturnVal: Boolean; virtual;
procedure SetToTrue; virtual; abstract;
end;
type TDerivedClass = class(TBaseClass)
public
procedure SetToTrue; override;
end;
function TBaseClass.ReturnVal: Boolean;
begin
result := B;
end;
procedure TDerivedClass.SetToTrue;
begin
B := True;
end;
var
inst: TBaseClass;
begin
inst := TDerivedClass.Create;
(inst as TDerivedClass).SetToTrue;
writeln(BoolToStr(inst.ReturnVal,true));
readln;
end.
und es tut auch... ich suche mal weiter!