.IndexOf() was added in
Studio's V2021.09.20n example of it use would be: index = array.IndexOf ( 123 ) ? so index will be assigned the index of the array if it can find the value 123, otherwise it will be -1
aka:
Syntax:
index = MyArray.IndexOf ( Value )
Result:
if Value found, will return first Index of MyArray containing Value, else returns -1
it's obviously slower than
sorted arrays and .Find()
and, both could use
expanded functionality.
otherwise, i haven't seen any test results of .IndexOf vs something like:
+ Code SnippetFunction Find(This)
Result = -1
For ThisIndex = 0 to MyArray.Length
If MyArray[ThisIndex] = This then ExitFunction ThisIndex
Next x
EndFunction Result