// *** before: ***
var
A: TArray<Integer>;
Names: TArray<string>;
begin
SetLength(A, 3); // length first...
A[0] := 1; // ...values one by one after
A[1] := 2;
A[2] := 3;
SetLength(Names, 2);
Names[0] := 'Anna';
Names[1] := 'Bob';
end;
// *** in version XE7: ***
var
A: TArray<Integer>;
Names: TArray<string>;
Buttons: TArray<TButton>;
begin
A := [1, 2, 3];
Names := ['Anna', 'Bob'];
// objects work the same way
Buttons := [Button1, Button2, Button3];
// and an empty list clears the array
A := [];
end;