/[svn]/doc/docbase/instrument_scripts/nksp/reference/functions/nksp_in_range_function.html
ViewVC logotype

Contents of /doc/docbase/instrument_scripts/nksp/reference/functions/nksp_in_range_function.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3601 - (show annotations) (download) (as text)
Mon Sep 16 16:03:36 2019 UTC (2 years, 1 month ago) by schoenebeck
File MIME type: text/html
File size: 2452 byte(s)
* NKSP: Added recently added built-in functions to reference docs.
* NKSP: Added info about std units and finalness to existing functions.
* NKSP: Added recently added built-in constants ~NI_MATH_E and ~NI_MATH_PI.

1 <html>
2 <head>
3 <meta name="author" content="Christian Schoenebeck">
4 <title>in_range() function</title>
5 <meta name="description" content="Checks whether a value is between two other values.">
6 </head>
7 <body>
8 <h1>in_range()</h1>
9 <p>
10 This function takes 3 integer values as arguments and checks whether the
11 1st integer value is in the range between the two integer values provided by the
12 2nd and 3rd arguments. The valid range includes the values of the 2nd and
13 3rd arguments.
14 </p>
15
16 <h3>Function Prototype</h3>
17 <p/>
18 <code lang="nksp">
19 in_range(??needle??,??low??,??high??)
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>??needle??</code></td>
29 <td>Integer Number</td>
30 <td>The value that is going to be checked whether it is in range.<br>
31 [required]</td>
32 </tr>
33 <tr>
34 <td><code>??low??</code></td>
35 <td>Integer Number</td>
36 <td>The smallest value of the valid range (including this value).<br>
37 [required]</td>
38 </tr>
39 <tr>
40 <td><code>??high??</code></td>
41 <td>Integer Number</td>
42 <td>The highest value of the valid range (including this value).<br>
43 [required]</td>
44 </tr>
45 </table>
46
47 <h3>Return Value</h3>
48 <table>
49 <tr>
50 <th>Data Type</th> <th>Description</th>
51 </tr>
52 <tr>
53 <td>Integer Number</td>
54 <td>Returns true (<code>1</code>) in case the value is in the allowed range, false (<code>0</code>) otherwise.</td>
55 </tr>
56 </table>
57
58 <h3>Remarks</h3>
59 <p>
60 This functions accepts any standard unit and finalness for its two arguments,
61 however the unit types of the two arguments must be identical. The return value
62 does never contain a unit nor finalness.
63 </p>
64
65 <h3>Examples</h3>
66 <p>
67 The following example prints the result of some example argument
68 values to the terminal as soon as the script is loaded.
69 <p/>
70 <code>
71 on init
72 message("in_range(1,4,9) = " & in_range(1,4,9))
73 message("in_range(5,4,9) = " & in_range(5,4,9))
74 message("in_range(9,4,9) = " & in_range(9,4,9))
75 message("in_range(10,4,9) = " & in_range(10,4,9))
76 end on
77 </code>
78
79 <h3>Availability</h3>
80 <p>Since LinuxSampler 2.0.0.svn36.<p>
81
82 </body>
83 </html>

  ViewVC Help
Powered by ViewVC