Background for Skyrim SE
Member of the SPE_Utility script
intfunctionFindIf_Int(int[]arr, stringlua)NativeGlobal

Description

Documentation Comment

Find the first element satisfying the function "predicate(a)"
Returns the index of the element, -1 if no such element exists, -2 if an error occursed
Example: FindIf_Int(arr, "function predicate(a) return a > 5 end") returns the index of the first element > 5
"lua" can also be a filepath to a .lua file containing the function, relative to Skyrim.exe


Parameters

  1. int[]arr

  2. stringlua


Examples

Auto-Generated Example

int[] myIntArray__arr
string myString__lua

int returnedValue = SPE_Utility.FindIf_Int(myIntArray__arr, myString__lua)
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.