The Delphi Language Guide states that New() and Dispose() call
Initialize() and Finalize(), respectively, on their argument to deal
with types that need to be initialized to NIL and disposed of properly.
What I am interested in is whether the automatic call to Initialize()
and Finalize() works properly in the case of arrays the elements of
which are records which have a WideString field. Like this:
Type
TRec = Record
S : WideString;
... // other fields
End;
TRecArray = Array[0..99] Of TRec;
PRecArray = ^TRecArray;
Var
PA : PRecArray;
...
New (PA);
...
Dispose (PA);
So the question is whether each element of PA^[] will be initialized to
zero (because of the WideString fields).
Thanks in advance,
András
> What I am interested in is whether the automatic call to Initialize()
> and Finalize() works properly in the case of arrays the elements of
> which are records which have a WideString field. Like this:
Yes, elements of arrays or correctly handled.
> So the question is whether each element of PA^[] will be initialized to
> zero (because of the WideString fields).
The only guarantee is that the WideString fields are initialized to
nil. There is no guarantee for the rest of the record.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com