[fpc-pascal] Array clearing

Jürgen Hestermann juergen.hestermann at gmx.de
Sat Apr 1 13:31:35 CEST 2017


I am wondering what the purpose of filling all
array elements with zero's could be.
If I want to discard all elements I would simply delete
the whole array (setlength(MyArray,0) ).

But when should it be useful to keep all elements and
just overwrite them all with zero's (which is also very time consuming)?
If the exisiting values are no longer valid then why not
simply delete these elements?
It's the fastest way to get rid of them.
If elements were zero before overwriting them with zero's
I cannot even distinguish between original and overwritten elements.




More information about the fpc-pascal mailing list