RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DynamicArray::Copy Method ()

Copies the contents of a DynamicArray to the specified DynamicArray.

Pascal
function Copy: DynamicArray<T>;
procedure Copy(var dst: DynamicArray<T>);
C++
DynamicArray<T> Copy() const;
void Copy(DynamicArray<T> & dst) const;

Use System::DynamicArray::Copy to make a copy of a dynamic array. Dynamic arrays are reference counted. Therefore assigning one to another simply copies the reference, not the data. The System::DynamicArray::Copy method, on the other hand, makes a separate copy of the dynamic array. The original contents of the destination array are discarded. 

The following code copies the contents of i_array into temp; temp and i_array must be of the same DynamicArray type.

temp = i_array.Copy();

 

CopyRange

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!