The FastFind function finds an item faster than Array.Find.
Before using FastFind, the array must be sorted.
Syntax
Integer Array.FastFind(
Pointer obj,
Integer iStart = 0,
Integer iEnd = -1)
Pointer obj,
Integer iStart = 0,
Integer iEnd = -1)
Parameters
| obj | Reference to find. | Required |
|---|---|---|
| iStart | Index of the first item. | Optional |
| iEnd | Index of the last item (excluded). -1: Last array item (included). | Optional |
Return value
The FastFind function returns the index of the found item.
If an error occurs, the FastFind function returns -1.
Example
Array myArray new
myArray.FastInsert(obj1)
myArray.FastInsert(obj2)
myArray.FastInsert(obj3)
index = myArray.FastFind(obj2)
myArray.FastInsert(obj1)
myArray.FastInsert(obj2)
myArray.FastInsert(obj3)
index = myArray.FastFind(obj2)