procedure TForm1.Button1Click(Sender: TObject);
var
buf:array of char;
buf2:array of char;
i,len:Integer;
begin
len:=10;
setlength(buf,len);
setlength(buf2,len);
for i:=low(buf) to high(buf) do
buf:='A';
for i:=low(buf2) to high(buf2) do
buf2:='B';
setlength(buf,len*2);
copymemory(@buf[len],@buf2[0],len*2);
showmessage(buf[21]);
end;