{concatenate element to array}
const
MAX = 5;
type
intArray = array of integer;
var
A : intArray;
i : integer;
procedure output;
begin
for i := low(A) to high(A) do
write(A[i]:3);
end;
begin
{method 1 - setlength}
for i := 1 to MAX do
begin
setlength(A, length(A) + 1);
A[high(A)] := random(10);
end;
output;
A := default(intArray);
writeln;
{method 2 - concat}
for i := 1 to MAX do
A := concat(A, [random(10)]);
output;
A := default(intArray);
writeln;
{method 3 - insert}
for i := 1 to MAX do
insert(random(10), A, length(A));
output;
writeln;
end.