Difference between revisions of "Ar Find"

118 bytes added ,  16:55, 7 September 2015
added Ar_BadNumericIndex/Ar_BadStringIndex info and example
imported>CSbot
(Automated import of articles)
 
imported>QQuix
(added Ar_BadNumericIndex/Ar_BadStringIndex info and example)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{BotAddedPage|CSbot|DragoonWraith}}
{{Function
{{Function
  | origin = OBSE
  | origin = OBSE
  | summary = 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. <tt>let key := ar_Find "tofind" arrayVar lowerBound:upperBound</tt>. If the value is not found, the function returns an empty string (for string-indexed arrays) or the value -99999.0 (for numeric-index arrays).
  | summary = 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. <tt>let key := ar_Find "tofind" arrayVar lowerBound:upperBound</tt>. 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.
  | name = ar_Find
  | name = ar_Find
  | returnVal = key
  | returnVal = key
Line 19: Line 18:
   }}
   }}
}}
}}
====Example====
if eval ( ar_Find MyValue MyArray ) ==  Ar_BadNumericIndex
    ;Value not present in array
endif


[[Category:Functions]]
[[Category:Functions]]
[[Category:Functions (OBSE)]]
[[Category:Functions (OBSE)]]
[[Category:Functions (OBSE v0017)]]
[[Category:Functions (OBSE v0017)]]
[[Category:Array Variable Functions (OBSE)]]
[[Category:Array Functions (OBSE)]]
Anonymous user