On Sat, Apr 14, 2012 at 04:23, Frank Church <[email protected]> wrote:
> Is it possible to make them virtual and override them or replace them
> in descendant classes?
======>>>======
{$mode objfpc}
type
tfooclass = class of tfoo;
tfoo = class
public
class function m1: string; virtual;
end;
tbar = class(tfoo)
public
class function m1: string; override;
end;
class function tfoo.m1: string;
begin
Result := 'tfoo';
end;
class function tbar.m1: string;
begin
Result := 'tbar';
end;
var
vclass: tfooclass;
begin
vclass := tfoo;
writeln('1: ', vclass.m1);
vclass := tbar;
writeln('2: ', vclass.m1);
end.
======<<<======
Joao Morais
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus