Array Declaration and Built-in Functions
Part:
1
2
3
4
5
(Continued from previous part...)
Here is the output:
Favorite pets:
Dog
Cat
Favorite fruits:
Apple
Orange
Erasing arrays...
Pets left:
Count = 2
Fruits left:
Count = 0
I don't see any surprises in the output. Do you?
Conclusions
- There two types of arrays: fixed-size array and dynamic-size array.
- "Dim" and "ReDim" specify upper bound of array index, not the size.
- "Array" is a useful function to create a dynamic-size array quickly.
- "For Each" can iterate through an array with a temporary variable to hold a copy of the current element value.
Part:
1
2
3
4
5
|