Arrays.Count
From Xojo Documentation
Method
Returns the number of rows in the array. For multi-dimensional arrays, the number of rows in a specific dimension will be returned if the dimension is passed.
Usage
result = array.Count([Index])
Part | Type | Description |
---|---|---|
result | Integer | The number of items in the array or dimension if passed.. |
array | Any valid data type | The array that you want to search. |
Index | Integer | Optional. If the array is multi-dimensional, this would be the dimension of which you wish to have returned the number of rows. |
Sample Code
This example displays the number of rows in the array:
Var days() As String
days() = Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday")
MessageBox("There are " + days.Count.ToString + " days."
days() = Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday")
MessageBox("There are " + days.Count.ToString + " days."