Documents
Writing Docs Gigedit SFZ Instrument Scripts NKSP Language NKSP Reference

search()

Searches for the sought value needle in the given array, if such a value is found, then this function returns the first index of the value being found. Otherwise if the array does not have such a value, it returns -1 instead.

Function Prototype

search(array, needle)

Arguments

Argument Name Data Type Description
array Integer Array Variable or
Real Array Variable
The array variable to be scanned.
[required]
needle Integer Number or
Real Number
The value to be searched for.
[required]

Return Value

Data Type Description
Integer Number Index of the first element found with that value, otherwise -1 if nothing found.

Remarks

If array is an Integer Array Variable then needle must be an Integer Number, or if array is a Real Array Variable then needle must be a Real Number instead.

Examples

None yet.

See also

sort(), array_equal()

Availability

Since LinuxSampler 2.0.0.svn52.

Document Updated:  2019-09-16  |  Author:  Christian Schoenebeck