[fpc-pascal] *** GMX Spamverdacht *** Re: Array clearing

Jürgen Hestermann juergen.hestermann at gmx.de
Wed Apr 12 16:54:42 CEST 2017


Am 2017-04-12 um 16:47 schrieb Michael Van Canneyt:
 >> Type MyType = record
 >>               A : Integer;
 >>               B : array of char;
 >>               C : array of Float;
 >>               end; // of record
 >>      ArrayA = array of MyType;
 >>      ArrayB = array of ArrayA.
 >>
 >> What would be the DefaultValue for
 >> ArrayB.Fill(DefaultValue);
 >> ?

 > I would think Nil is the only option here,  ArrayB is an array of arrays

Yes, but that's not what Ryan and others want to achieve.
As far as I understand, ArrayB.Fill should fill all the
lowest (non-managed) types like Integer, Char and Float.
Otherwise it would not be "filling" but "clearing" because
some memory allocation is lost.

So you would need multiple DefaultValues but I don't see how this can be done.



More information about the fpc-pascal mailing list