1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>search() function</title> |
5 |
<meta name="description" content="Search for a certain value within an array."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>search()</h1> |
9 |
<p> |
10 |
Searches for the sought value <code>??needle??</code> in the given |
11 |
<code>??array??</code>, if such a value is found, then this function |
12 |
returns the first index of the value being found. Otherwise if the |
13 |
array does not have such a value, it returns <code>-1</code> instead. |
14 |
</p> |
15 |
|
16 |
<h3>Function Prototype</h3> |
17 |
<p/> |
18 |
<code lang="nksp"> |
19 |
search(??array??, ??needle??) |
20 |
</code> |
21 |
|
22 |
<h3>Arguments</h3> |
23 |
<table> |
24 |
<tr> |
25 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
26 |
</tr> |
27 |
<tr> |
28 |
<td><code>??array??</code></td> |
29 |
<td>Integer Array Variable</td> |
30 |
<td>The integer array variable to be scanned.<br> |
31 |
[required]</td> |
32 |
</tr> |
33 |
<tr> |
34 |
<td><code>??needle??</code></td> |
35 |
<td>Integer Number</td> |
36 |
<td>The value to be searched for.<br> |
37 |
[required]</td> |
38 |
</tr> |
39 |
</table> |
40 |
|
41 |
<h3>Return Value</h3> |
42 |
<table> |
43 |
<tr> |
44 |
<th>Data Type</th> |
45 |
<th>Description</th> |
46 |
</tr> |
47 |
<tr> |
48 |
<td>Integer Number</td> |
49 |
<td>Index of the first element found with that value, otherwise <code>-1</code> if nothing found.</td> |
50 |
</tr> |
51 |
</table> |
52 |
|
53 |
<h3>Examples</h3> |
54 |
<p>None yet.</p> |
55 |
|
56 |
<h3>See also</h3> |
57 |
<p><code>sort()</code>, <code>array_equal()</code><p> |
58 |
|
59 |
<h3>Availability</h3> |
60 |
<p>Since LinuxSampler 2.0.0.svn52.<p> |
61 |
|
62 |
</body> |
63 |
</html> |