[fpc-pascal] dynamic array contents and system.move

J├╝rgen Hestermann juergen.hestermann at gmx.de
Sun Apr 25 18:29:26 CEST 2010


> I think there is a great difference between normal arrays and dynamic ones

Yes, but it should not be like that. If you first declare a static array and then decide to make it a dynamic array then *no* code change should be required.  But now it is for move and fillchar.

> is OK, but in dynamic arrays it should be:
> A: array of integer;
> SetLength(A,2);

Why change the array length here? The array has a length already. What if the array had 10 elements before? 

> move (a[0],somewhere^,4);
> move (a[1],(somewhere+4)^,4);
> Because I think dynamic arrays does not garantee that all elements are
> together in a big chunck. 

I think that this *is* guaranteed. 



More information about the fpc-pascal mailing list