The FastIndex function retrieves the index of the specified item to insert.
The FastIndex function returns the same value than Array.FastInsert without inserting the item.
Before using FastIndex, the array must be sorted.
See Array.OnCompare.
Syntax
Integer Array.FastIndex(
Pointer obj,
Integer iStart = 0,
Integer iEnd = -1)
Pointer obj,
Integer iStart = 0,
Integer iEnd = -1)
Parameters
| obj | Reference to add. | Required |
|---|---|---|
| iStart | Index of the first item. | Optional |
| iEnd | Index of the last item (excluded). -1: Last array item (included). | Optional |
Return value
The FastIndex function returns the index of the item.
If an error occurs, the FastIndex function returns -1.
Example
index = myArray.FastIndex(obj1)