1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>inc() function</title> |
5 |
<meta name="description" content="Increments the passed integer variable by one."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>inc()</h1> |
9 |
<p> |
10 |
Increments the passed integer variable by one and returns the incremented value. |
11 |
Accordingly you may only pass script variables of type integer which are allowed |
12 |
to modified (i.e. they may not be declared as <code lang="nksp">const</code>). |
13 |
</p> |
14 |
|
15 |
<h3>Function Prototype</h3> |
16 |
<p/> |
17 |
<code lang="nksp"> |
18 |
inc(??variable??) |
19 |
</code> |
20 |
|
21 |
<h3>Arguments</h3> |
22 |
<table> |
23 |
<tr> |
24 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
25 |
</tr> |
26 |
<tr> |
27 |
<td><code>??variable??</code></td> |
28 |
<td>Integer Variable</td> |
29 |
<td>The integer variable to be incremented by one.<br> |
30 |
[required]</td> |
31 |
</tr> |
32 |
</table> |
33 |
|
34 |
<h3>Return Value</h3> |
35 |
<table> |
36 |
<tr> |
37 |
<th>Description</th> <th>Data Type</th> |
38 |
</tr> |
39 |
<tr> |
40 |
<td>Value of the passed variable after the incrementation.</td> |
41 |
<td>Integer Number</td> |
42 |
</tr> |
43 |
</table> |
44 |
|
45 |
<note> |
46 |
The return value of this function is an extension by NKSP to allow |
47 |
inline incrementation (like shown in the example below). However if |
48 |
you want to preserve compatibility with KSP then you should not rely |
49 |
on having a return value. |
50 |
</note> |
51 |
|
52 |
<h3>Examples</h3> |
53 |
<p/> |
54 |
<code> |
55 |
on init |
56 |
declare $i |
57 |
|
58 |
message("inc(" & $i & ") = " & inc($i)) |
59 |
message("inc(" & $i & ") = " & inc($i)) |
60 |
message("inc(" & $i & ") = " & inc($i)) |
61 |
|
62 |
message("dec(" & $i & ") = " & dec($i)) |
63 |
message("dec(" & $i & ") = " & dec($i)) |
64 |
message("dec(" & $i & ") = " & dec($i)) |
65 |
|
66 |
end on |
67 |
</code> |
68 |
|
69 |
<h3>Availability</h3> |
70 |
<p>Since LinuxSampler 2.0.0.svn15.<p> |
71 |
|
72 |
</body> |
73 |
</html> |