0
I am trying to make an array of subclasses in this format:
arrayReg : Array[0..1] of TRegDom = (TRegDom0000);
Tregdom0000 being a subclass of Tregdom (Tregdom0000(Tregdom)) and gives an error of "Incompatible types E2010":
'Tregdom' and 'class of Tregdom0000'
I couldn’t quite understand what you want to do... if you want to initialize the array, I believe you have to put an instance of the class where you placed the Tregdom0000 class
– imex
I need this array so I can go through all the Tregdom descendants, all methods are like class functions / procedures, because I don’t need to instantiate them. I wanted an array with all subclasses, I do it in JAVA exactly this way with superclass and subclass but not working in Delphi.
– Ademar-SJ
I may be wrong but I believe that it is not possible to create this array in Delphi/Pascal, probably the way to do it should be totally different
– imex
Doing this by initializing the array will not do it. But I think you can do it in the code body, with a cast
– Tiago Rodrigues