×
Fallout Wiki
☢  Independent Fallout Wiki Resources  Vault logo
Resource:Creation Kit > Find - Array


Member of: All Arrays

Locates a particular value inside an array and returns the index

Syntax[edit]

int Function Find(;/element type/; akElement, int aiStartIndex = 0) native

Parameters[edit]

  • akElement: The element to locate
  • aiStartIndex: Where to start the search
    • Default: 0

Return Value[edit]

The index of the item in the array, or a negative value if it was not found.

Examples[edit]

if (MyIntArray.Find(1) < 0)
  Debug.Trace("Did not find 1 in the array")
endIf


int firstPosition = MyStringArray.Find("Hello")
Debug.Trace("Found Hello at position " + firstPosition)
int secondPosition = MyStringArray.Find("Hello", firstPosition + 1)
Debug.Trace("Found a second Hello at position " + secondPosition)

See Also[edit]