/[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 2945 - (show annotations) (download)
Thu Jul 14 00:22:26 2016 UTC (7 years, 9 months ago) by schoenebeck
File MIME type: text/plain
File size: 1912 byte(s)
* NKSP: Implemented built-in script function "inc()".
* NKSP: Implemented built-in script function "dec()".
* NKSP language fix: division expressions were evaluated too often.
* NKSP language fix: string concatenation operator was right
  associative instead of left (to right).
* Bumped version (2.0.0.svn15).

1 on init
2 declare $i
3 declare @s := "foo" & " bar"
4 message(@s)
5
6 message("4 + 3 is " & 4 + 3)
7 message("10 mod 8 -> " & 10 mod 8)
8
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 message("Relation 3 = 4 -> " & 3 = 4)
15
16 message("Logical operation 1 and 2 = " & 1 and 2)
17 message("Logical operation 1 and 3 = " & 1 and 3)
18 message("Logical operation 1 and 0 = " & 1 and 0)
19 message("Logical operation 1 or 2 = " & 1 or 2)
20 message("Logical operation 1 or 1 = " & 1 or 1)
21 message("Logical operation 1 or 0 = " & 1 or 0)
22 message("Logical operation 0 or 0 = " & 0 or 0)
23
24 message("Logical operation not 1 = " & not 1)
25 message("Logical operation not 2 = " & not 2)
26 message("Logical operation not 0 = " & not 0)
27
28 message("Bitwise operation 1 .and. 2 = " & 1 .and. 2)
29 message("Bitwise operation 1 .and. 3 = " & 1 .and. 3)
30 message("Bitwise operation 1 .and. 0 = " & 1 .and. 0)
31 message("Bitwise operation 1 .or. 2 = " & 1 .or. 2)
32 message("Bitwise operation 1 .or. 1 = " & 1 .or. 1)
33 message("Bitwise operation 1 .or. 0 = " & 1 .or. 0)
34 message("Bitwise operation 0 .or. 0 = " & 0 .or. 0)
35
36 message("Bitwise operation .not. 1 = " & .not. 1)
37 message("Bitwise operation .not. 2 = " & .not. 2)
38 message("Bitwise operation .not. 0 = " & .not. 0)
39 message("Bitwise operation .not. -1 = " & .not. -1)
40
41 message("abs(-3) = " & abs(-3))
42
43 message("inc(" & $i & ") = " & inc($i))
44 message("inc(" & $i & ") = " & inc($i))
45 message("inc(" & $i & ") = " & inc($i))
46 message("dec(" & $i & ") = " & dec($i))
47 message("dec(" & $i & ") = " & dec($i))
48 message("dec(" & $i & ") = " & dec($i))
49
50 message("random(-5,5) = " & random(-5,5))
51 message("random(-5,5) = " & random(-5,5))
52 message("random(-5,5) = " & random(-5,5))
53
54 end on

  ViewVC Help
Powered by ViewVC