Ar Find
Revision as of 15:55, 7 September 2015 by imported>QQuix (added Ar_BadNumericIndex/Ar_BadStringIndex info and example)
< [[::Category:Functions|Category:Functions]]
A function added by the Oblivion Script Extender.
Syntax:
(key:stringOrNumber) ar_Find value:stringOrNumberOrForm arrayToSearch:array inRange:range
Locates the first occurrence of the specified value within an array and returns the key associated with it. A range may optionally be specified using range notation, i.e. let key := ar_Find "tofind" arrayVar lowerBound:upperBound. If the value is not found, the function returns Ar_BadStringIndex (an empty string) for string-indexed arrays or Ar_BadNumericIndex (the value -99999.0) for numeric-indexed arrays.
Example
if eval ( ar_Find MyValue MyArray ) == Ar_BadNumericIndex ;Value not present in array endif