Arrays

An array is a group of elements of the same type that have a common name.
An array is a collection of elements that use the same name but are distinguished by an index value.
An array is an indexed collection of objects.
Arrays contain a sequence of variables.


Different Types of Arrays

There are several different types of arrays:
Fixed size array which remains the same size and a
Dynamic size array whose size can change at run-time.



Zero Based

All arrays are zero based
The following line declares an array containing 10 elements from 0 to 9.

Dim aiArrayIntegers(10) As Integer 

Because the first element of every array has a zero index the "To" keyword inside a Dim statement is no longer supported.
The Option Base statement is no longer supported.


Arrays are collections of objects of the same type.
The size must be decided when the array is created.
Each item in the array is accessed by an index, which is just a number that indicates the position where the object is stored.
Arrays can be used to store both Reference Types and Value Types.
Arrays use zero-based indexes, so that the first element in the array is element 0.




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopNext