Recording the color value of a pixel
Recording the color value of a matrix Applications of Arrays
1.Fixed-size array
2.Dynamic array Types of Arrays
1.Fixed-size array Has a fixed number of elements
2.Dynamic array The number of elements can be changed at any point during runtime
Declaring Arrays: Fixed Size oKeyword used is Dim
oSyntax:
Dim ArrayName(UBound1 [,... ,UBoundN]) As Type
oExamples:
Dim TempReading(9) As Double
DimHourlyData(23) As Double
Dim RainfallData(11,30) As Decimal
DimmyClassmates(29) As String
, Declaring Arrays: Dynamic oKeyword used is Dim
oSyntax:
DimArrayName( ) As Type
oCommas can be placed inside the parentheses to specify the number of dimensions
oExamples:
DimTempReading() As Double
Dim RainfallData(,) As Decimal
DimMyCube(,,) As Long
Storing Values: Fixed Size oEquate each element to an expression
oExample:
DimCalorieIntake(6) As Decimal
'assignment statements
CalorieIntake(0) = 2300
CalorieIntake(1) = 2000
CalorieIntake(2) = 1800
up to...
CalorieIntake(6) = 1700
Storing Values: Fixed Size oUse the For Next loop's counter to represent the index for
each element