Lokale Variablen mit Referenzzählung werden immer mit nil (oder '') initialisiert. Alle anderen muss man selber initialisieren.
Zitat:
Local reference-counted* variables are always initialized to nil or '';
https://stackoverflow.com/a/132770/80901
Barry Kelly schrieb dazu:
Zitat:
Local variables are initialized as if they were passed to the Initialize routine. The Initialize routine uses runtime type-info (
RTTI) to zero-out fields (recursively - if a field is of an array or record type) and arrays (recursively - if the element type is an array or a record) of a managed type, where a managed type is one of:
AnsiString
UnicodeString
WideString
an interface type (including method references)
dynamic array type
Variant
https://stackoverflow.com/a/861178/80901