Hi Leute,
Ich habe viele gleichartige Klassen, die alle den gleichen Vorfahr haben. Kann ich jetzt einen Typ o.ä. definieren, der Alle klassen beinhaltet?
qasi:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
| type TFoo = class private public bla : byte; end;
TFooKind=class(TFoo) private
public blub : String; end;
TBar=class(TFoo) private Strump : Boolean; public end; |
Dass ich jetzt einen Typ o.Ä. habe, in den ich alle Klassen packen kann? Also sozusagen:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9:
| var FooFamily : Array of TOberbegriff; Foo : TFoo; Bar : TBar; FooKind : TFooKind; begin FooFamily[index] := Bar; FooFamily[index+2]:= FooKind; end; |