Object Pascal is very sad working with dynamic arrays.
\r
Much better and, importantly, faster in terms of execution of the code will use string.
\r
And then getter and setter to drag/assign the elements.
\r
Ie
a: string;
\r
designer setlength(a, n*4) (*8 if a 64 bit application)
\r
and methods
getElement(x:integer)
var tmpInt:integer;
move(a[(x*4)+1], tmpInt, 4); (8 64 bit)
result:=tmpInt;
\r
setElement(x, value:integer)
var tmpInt:integer;
tmpInt:=value;
move(tmpInt, a[(x*4)+1], 4); (everywhere 8 to 64 bits)
\r
It is, at first glance, more complicated than the previous answer, but in fact the problems will be less. With gears as parametrov to the function, using inside other functions, etc.