That junk is from uninitialized values
Dynamische Arrays und LongStrings (String, UnicodeString, AnsiString und deren Ableitungen / nicht ShortString) sind immer initialisiert,
so wie es bei allen managed Typen der Fall ist..
Thank you and i know that, also saw what Delphi
IDE/Compiler can do, please have a look at this code and see why it is crashing on x32 while crashing the debugger itself on x64, on my XE8, so no guarantee on the behavior on newer version though.
Code:
procedure TForm10.FormCreate(Sender: TObject);
var
a:array of string;
begin
SetLength(a,4);
a[0]:='string1';
a[1]:='string2';
a[2]:='string3';
a[3]:='string4';
SetLength(a,2);
SetLength(a,4);
ShowMessage(a[4]);
end;