Dynamic Size

Dynamic arrays do not have a fixed size and can be resized at run-time.
These are also known as Variable Arrays or Variable-Length Arrays.
This type of array is very useful when you don't know the exact size of the array at design time.

Explicit Lower Bound

It is possible to explicitly declare the lower bound of your dynamic array.
The following two lines are equivalent and both these arrays contain 101 elements.
The index values range from 0 to 100.

ReDim myArray(100) 
ReDim myArray(0 to 100)

A dynamic array does not have a pre-defined number of elements
Resizing arrays at run-time can be very inefficient. If adding a lot of data dynamically do not resize the array after every new element but after every 10 or so.

Adding and Removing is the same as for Fixed Size arrays.

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext