- Found in:
- Scrab's PE
[DEV SERVER] Loading description...
Caveats
Parameters
int[]arr
stringlua
Examples
Auto-Generated Example
int[] myIntArray__arr
string myString__lua
int returnedValue = SPE_Utility.FindIf_Int(myIntArray__arr, myString__lua)
[DEV SERVER] Loading description...
int[] myIntArray__arr
string myString__lua
int returnedValue = SPE_Utility.FindIf_Int(myIntArray__arr, myString__lua)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