[fpc-pascal] How to know if a class implements a method
post at joaomorais.com.br
Fri May 18 15:24:22 CEST 2007
Any idea how I know if a class, in a class pointer, overrides a virtual
tfooclass = class of tfoo;
tfoo = class
procedure sample; virtual;
tboo1 = class(tfoo)
tboo2 = class(tfoo)
procedure sample; override;
vfooclass := tboo1;
// vfooclass doesn't implement sample.
vfooclass := tboo2;
// vfooclass implements sample.
At this moment I know that:
1. I could cast a method pointer with tmethod if sample was a class method;
2. I could cast this same method pointer if I had an instance of vfooclass.
But is there another way beyond creating an instance?
More information about the fpc-pascal