Add Subclasses types to the end of an ARRAY



Add items (objects subclasses types) to the end of an ARRAY - List ClassName
Smart pascal source code
type TTest = class end; type TTestClass = class of TTest; end; var c := TTestClass; a: array of TObject; t: array of TTest; procedure Test(a: array of TTest); begin a.Add(TTest.Create); a.Add(c.Create); end; begin a.Add(TTest.Create); a.Add(c.Create); Writeln(a[0].ClassName); // TTest Writeln(a[1].ClassName); // TTest //------------------------ Test(t); Writeln(t[0].ClassName); // TTest Writeln(t[1].ClassName); // TTest