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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2581 - (show annotations) (download)
Fri May 30 12:48:05 2014 UTC (9 years, 10 months ago) by schoenebeck
File MIME type: text/plain
File size: 671 byte(s)
* (WIP) Implemented parser and VM for upcoming new real-time instrument
  script support. It needs yet to be integrated into the sampler's
  sampler engines. You can toy around for now with the command line tool
  "ls_instr_script" and i.e. examples showing the core language features
  under src/scriptvm/examples/.
* Bumped version (1.0.0.svn41).

1 { Array variables are always global variables, with constant size defined at
2 parse time. Trying to declare an array size with a runtime expression (i.e. a
3 non const variable), will cause a parser error. }
4
5 on init
6 declare const $SIZE := 5
7 declare %a[$SIZE] := ( 0,1,2,3,4 )
8 declare $i
9
10 message("Initial values of array:")
11
12 $i := 0
13 while ($i < $SIZE)
14 message("array[" & $i & "] = " & %a[$i])
15 $i := $i + 1
16 end while
17
18 %a[0] := 2
19 %a[1] := 3
20 %a[2] := 5
21 %a[3] := 7
22 %a[4] := 11
23
24 message("")
25 message("New values of array:")
26
27 $i := 0
28 while ($i < $SIZE)
29 message("array[" & $i & "] = " & %a[$i])
30 $i := $i + 1
31 end while
32
33 end on

  ViewVC Help
Powered by ViewVC