Background for Skyrim SE
Member of the JFormMap script
FormfunctionnextKey(intobject, FormpreviousKey=NONE, FormendKey=NONE)NativeGlobal

Description

Documentation Comment

Simplifies iteration over container's contents.
Accepts the @previousKey, returns the next key.
If @previousKey == @endKey the function returns the first key.
The function always returns so-called 'valid' keys (the ones != @endKey).
The function returns @endKey ('invalid' key) only once to signal that iteration has reached its end.
In most cases, if the map doesn't contain an invalid key ("" for JMap, None form-key for JFormMap)
it's ok to omit the @endKey.

Usage:

  string key = JMap.nextKey(map, previousKey="", endKey="")
  while key != ""
    <retrieve values here>
    key = JMap.nextKey(map, key, endKey="")
  endwhile

Parameters

  1. intobject

  2. FormpreviousKey=NONE

  3. FormendKey=NONE


Examples

Auto-Generated Example

int myInt__object
Form myForm__previousKey
Form myForm__endKey

Form returnedValue = JFormMap.nextKey(myInt__object, myForm__previousKey, myForm__endKey)
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.