Am 2017-04-12 um 16:17 schrieb Ryan Joseph: > SetLength resizes the array in memory and “clear” means setting all values to default() for that type.
"clear" is not very clear to me ;-) IMO SetLength(array,0) is clearing too. The function you want should be called "Fill". For example a function Array.Fill(DefaultValue); But what happens to a multi-dimensional (dynamic) array? For example, how to handle this case: 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 don't see how this can be achieved in a solid and easy to unterstand Array.Fill routine.... _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal