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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3078 - (hide annotations) (download)
Thu Jan 5 18:11:00 2017 UTC (7 years, 3 months ago) by schoenebeck
File MIME type: text/plain
File size: 2767 byte(s)
- Just minor update to NKSP example.

1 schoenebeck 2581 on init
2 schoenebeck 2945 declare $i
3 schoenebeck 2581 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 schoenebeck 2935 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 schoenebeck 2581
24 schoenebeck 2935 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 schoenebeck 2619
36 schoenebeck 2935 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 schoenebeck 2965 message("sh_left(1,0) = " & sh_left(1,0))
42     message("sh_left(1,1) = " & sh_left(1,1))
43     message("sh_left(1,2) = " & sh_left(1,2))
44     message("sh_left(1,3) = " & sh_left(1,3))
45     message("sh_left(1,4) = " & sh_left(1,4))
46    
47     message("sh_right(128,0) = " & sh_right(128,0))
48     message("sh_right(128,1) = " & sh_right(128,1))
49     message("sh_right(128,2) = " & sh_right(128,2))
50     message("sh_right(128,3) = " & sh_right(128,3))
51    
52 schoenebeck 2619 message("abs(-3) = " & abs(-3))
53    
54 schoenebeck 2970 message("min(2,3) = " & min(2,3))
55     message("min(1,11) = " & min(1,11))
56     message("min(-30,4) = " & min(-30,4))
57    
58     message("max(2,3) = " & max(2,3))
59     message("max(1,11) = " & max(1,11))
60     message("max(-30,4) = " & max(-30,4))
61    
62 schoenebeck 2945 message("inc(" & $i & ") = " & inc($i))
63     message("inc(" & $i & ") = " & inc($i))
64     message("inc(" & $i & ") = " & inc($i))
65     message("dec(" & $i & ") = " & dec($i))
66     message("dec(" & $i & ") = " & dec($i))
67     message("dec(" & $i & ") = " & dec($i))
68    
69 schoenebeck 3078 message("in_range(1,4,9) = " & in_range(1,4,9))
70     message("in_range(5,4,9) = " & in_range(5,4,9))
71     message("in_range(9,4,9) = " & in_range(9,4,9))
72     message("in_range(10,4,9) = " & in_range(10,4,9))
73    
74 schoenebeck 2619 message("random(-5,5) = " & random(-5,5))
75     message("random(-5,5) = " & random(-5,5))
76     message("random(-5,5) = " & random(-5,5))
77    
78 schoenebeck 2581 end on

  ViewVC Help
Powered by ViewVC