Hi, is it possible to have a virtual class variable? I want to have a
pointer available per class that can be a different value.
Something like this:

  TA = class
    class var Foo: TObject; virtual;
  end;

  TB = class(TA)
    class var Foo: TSpecialObject; override;
  end;
     

I have in mind multiple levels of inheritance. I am storing a vmt like
record/object in the variable, so the variable the child class overrides
will be compatible with the ancestor class. It's possible there may be
many instances of the objects so I do not want to create an variable per
instance if I can help it.

Regards,

Andrew
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to