Well the most simple solution is to create a constructor function and use the built-in array operators (activate through modeswitch):
{$ModeSwitch arrayoperators}
type
TFoo = record
X, Y: Integer;
end;
function Foo(const X, Y: Integer): TFoo; inline;
begin
Result.X := X;
Result.Y := Y;
end;
var
arr: Array of TFoo;
begin
Arr:=[];
Arr+=[Foo(42, 32)];
end.
This has a few advantages over the examples shown above:
1. By using a normal function instead of a constructor inlining can be performed. Constructors cannot be inlined, so especially if the record is very small, a normal inlined function will perform better
2. The + operator with modeswitch ArrayOperators is overladed for every single array type, so no need to overload your own operators
3. While the + operator only appends lists, there is an optimization that for single elements it's basically reduced to an Insert, meaning that with the same syntax for appending 1 or any number of elements, the compiler automatically decides the optimal way to perform this operation, so no manual optimization necessary.