Putzig.
Allerdings kannte ich bisher nur den expliziten Weg über SetLength():
Delphi-Quellcode:
function concatenateByteS : TBytes;
var
firstArray, secondArray: TBytes;
begin
firstArray := TFile.ReadAllBytes('C:\Development\DelphiLib\FastMM\FastMM4_FAQ.txt');
secondArray := TFile.ReadAllBytes('C:\Development\DelphiLib\FastMM\FastMM4_FAQ.txt');
SetLength(result, Length(firstArray) + Length(secondArray));
Move(firstArray[0], result[0], Length(firstArray));
Move(secondArray[0], result[Length(firstArray)], Length(secondArray));
//result := firstArray + secondArray;
end;
Der geht.
Ich hielte es bislang auch für einen Fehler, auf SetLength() zu verzichten.
Daniel R. Wolf
mit Grüßen aus Hamburg