Ar Next


Revision as of 09:59, 10 December 2014 by Odessa (Talk | contribs) (Improved example)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A function added by the New Vegas Script Extender.


Returns the next key of an array, after the one specified. For regular arrays (list arrays) this is just equivalent to (SpecifiedKey + 1). This function is most useful for map and stringmap arrays, where keys are dynamic.

Note that map and stringmap arrays are always sorted in ascending numeric or alphanumeric order, regardless of the order elements were inserted.

Returns a bad index (Ar_BadNumericIndex or Ar_BadStringIndex) if there is no next key in the array.


(key:int/float/string) Ar_Next Source:array Key:int/float/string


array_var MyMap
float MapKey ; * or string_var as appropriate for array

let MapKey := Ar_First MyMap ; * The First Key

let MapKey := Ar_Next MyMap, MapKey ; * The Next Key

if MapKey == Ar_BadNumericIndex
    ; Then there is no next key in the map

See Also

Personal tools