<div class="meta" robots="noindex">

</div>

Method

# Arrays.FirstRowIndex

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `Arrays.FirstIndex<arrays.firstindex>` as a replacement.

</div>

## Description

Returns the index of the first row of the array.

## Usage

*result* = *array*.**FirstRowIndex**

| Part   | Type                               | Description                                    |
|--------|------------------------------------|------------------------------------------------|
| result | `Integer</api/data_types/integer>` | The starting index of the array.               |
| array  | Array of any data type             | The array whose first element number you want. |

## Notes

The <span class="title-ref">FirstRowIndex</span> function is used to determine the first element of an array. This is especially useful for writing code that loops through arrays so that you don't have to be aware of whether an array begins at 0 or 1 (they all begin at 0).

Arrays can have a maximum index value of 2,147,483,646.

## Sample code

This code loops through an array and replaces each occurrence of X in an array with Y.

``` xojo
For i As Integer = names.FirstRowIndex To names.LastRowIndex
  If names(i) = "X" Then
    names(i) = "Y"
  End If
Next
```

## Compatibility

All project types on all supported operating systems.

## See also

`Arrays</api/language/arrays>` parent class; `Var</api/language/var>` statement; `Arrays</api/language/arrays>` concept, `ParamArray</api/language/paramarray>` keyword, `Arrays.LastIndex<arrays.lastindex>` method
