Wednesday, October 27, 2010

Arrays

An array is an indexed list of related information of the same data type. One way to think of an array is list of variables of the same data type.

Each position in the array is called an Index. Indexes begin at zero (0).

A declaration statement is used to declare the existence of the array. It is defined as a particular data type. Each index may then be assigned a value.

Syntax
Dim ArrayName() As DataType

Dim intTopScore() As Integer = {23000,23500,23070,23008,23708}

The example above is an array of 5 integers. The first integer sits at Index zero (0) and the last integer sits at Index four (4).

No comments:

Post a Comment