/[svn]/linuxsampler/trunk/src/scriptvm/examples/expressions.txt
ViewVC logotype

Contents of /linuxsampler/trunk/src/scriptvm/examples/expressions.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2935 - (show annotations) (download)
Sun Jul 10 14:24:13 2016 UTC (7 years, 9 months ago) by schoenebeck
File MIME type: text/plain
File size: 1646 byte(s)
* NKSP: Added & implemented built-in script function "change_cutoff()".
* NKSP: Added & implemented built-in script function "change_reso()".
* NKSP: Added & implemented built-in script function "event_status()".
* NKSP: Added built-in script constants "$EVENT_STATUS_INACTIVE" and
  "$EVENT_STATUS_NOTE_QUEUE" both for being used as flags for
  built-in "event_status()" script function.
* NKSP language: Added support for bitwise operators ".or.", ".and."
  and ".not.".
* NKSP language scanner: Fixed IDs matching to require at least one
  character (i.e. when matching function names or variable names).
* NKSP language scanner: disabled unusued rules.
* Bumped version (2.0.0.svn12).

1 on init
2 declare @s := "foo" & " bar"
3 message(@s)
4
5 message("4 + 3 is " & 4 + 3)
6 message("10 mod 8 -> " & 10 mod 8)
7
8 message("Relation 3 < 4 -> " & 3 < 4)
9 message("Relation 3 > 4 -> " & 3 > 4)
10 message("Relation 3 <= 4 -> " & 3 <= 4)
11 message("Relation 3 >= 4 -> " & 3 >= 4)
12 message("Relation 3 # 4 -> " & 3 # 4)
13 message("Relation 3 = 4 -> " & 3 = 4)
14
15 message("Logical operation 1 and 2 = " & 1 and 2)
16 message("Logical operation 1 and 3 = " & 1 and 3)
17 message("Logical operation 1 and 0 = " & 1 and 0)
18 message("Logical operation 1 or 2 = " & 1 or 2)
19 message("Logical operation 1 or 1 = " & 1 or 1)
20 message("Logical operation 1 or 0 = " & 1 or 0)
21 message("Logical operation 0 or 0 = " & 0 or 0)
22
23 message("Logical operation not 1 = " & not 1)
24 message("Logical operation not 2 = " & not 2)
25 message("Logical operation not 0 = " & not 0)
26
27 message("Bitwise operation 1 .and. 2 = " & 1 .and. 2)
28 message("Bitwise operation 1 .and. 3 = " & 1 .and. 3)
29 message("Bitwise operation 1 .and. 0 = " & 1 .and. 0)
30 message("Bitwise operation 1 .or. 2 = " & 1 .or. 2)
31 message("Bitwise operation 1 .or. 1 = " & 1 .or. 1)
32 message("Bitwise operation 1 .or. 0 = " & 1 .or. 0)
33 message("Bitwise operation 0 .or. 0 = " & 0 .or. 0)
34
35 message("Bitwise operation .not. 1 = " & .not. 1)
36 message("Bitwise operation .not. 2 = " & .not. 2)
37 message("Bitwise operation .not. 0 = " & .not. 0)
38 message("Bitwise operation .not. -1 = " & .not. -1)
39
40 message("abs(-3) = " & abs(-3))
41
42 message("random(-5,5) = " & random(-5,5))
43 message("random(-5,5) = " & random(-5,5))
44 message("random(-5,5) = " & random(-5,5))
45
46 end on

  ViewVC Help
Powered by ViewVC