[fpc-pascal] Array clearing

Ryan Joseph ryan at thealchemistguild.com
Wed Apr 12 16:17:17 CEST 2017


> On Apr 12, 2017, at 9:07 PM, Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:
> 
> What exactly does it do when "clearing" a dynamic array?
> There are multiple ways to "clear" it.

I see your point but there could be a good API to make this clear. SetLength resizes the array in memory and “clear” means setting all values to default() for that type. Not a difficult distinction to remember imo. The whole API is incomplete though so it doesn’t even make sense to add this unless your going to overhaul everything and make a complete list of operations.


Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list