System.DynamicArray.Length

From RAD Studio API Documentation
Jump to: navigation, search

C++

__property DynArrInt Length = {read=get_length, write=set_length};

Properties

Type Visibility Source Unit Parent
property public sysdyn.h System DynamicArray

Description

Represents the number of elements in the DynamicArray.

Use the Length property to set or get the length of the dynamic array. The following code sets the length of a DynamicArray to 10.

DynamicArray<int> arrayOfInt;

arrayOfInt.Length = 10;
cout << "ArrayLength: " << arrayOfInt.Length << endl;

SetLength(arrayOfInt, 10);

To free a dynamic array, simply set its Length to 0:

arrayOfInt.Length = 0;

See Also

Code Examples