The FastInsert function retrieves the correct index of the new item before inserting it.
You must call FastInsert if you want to use Array.FastFind without sorting the array.
Before using FastInsert, the array must be sorted.
Syntax
Integer Array.FastInsert(
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 FastInsert function returns the index of the new item.
If an error occurs, the FastInsert function returns -1.
Example
myArray.FastInsert(obj1)
myArray.FastInsert(obj2)
myArray.FastInsert(obj2)