XClassEx : array of Unit2.TclassExample; // okay
//xClassEx := unit2.TClassExample(self); // does not work
setlength(xclassEx,100); // okay
// add to the array I get an access error
// How do I initialize the array.
// TclassExample is a record containing variable data
The main thing to remember about Class types is that declaring one is
not enough, you must also construct it.
var
Foo: Array of TMyClass
begin
SetLength(Foo,10);
/// Foo[0] := TMyClass.Create; // if we don't do this first...
Foo[0].property1 := 10; // ... then we get an Access violation!
end;