[fpc-pascal] Schema Types

Florian Klaempfl florian at freepascal.org
Mon Dec 22 16:38:16 CET 2008


Jonas Maebe schrieb:
> 
> One important different to keep in mind between dynamic arrays and 
> regular arrays (including those defined using schema types): dynamic 
> arrays are reference counted and copies are always shallow copies. This 
> means that in this code:
> 
> var
>   a, b: array of real;
> begin
>   setlength(a,10);
>   b:=a;

The proper way to do a copy is
b:=copy(a);
:)

It's only a one level deep copy though.




More information about the fpc-pascal mailing list