blob: f72a6c9f20c95a806f62acad2fc1adca0bff2282 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<refentry id="evalstr">
<indexterm id="Indexevalstr"><primary>evalstr</primary></indexterm>
<refentryinfo><title>Instrument Control:Compilation</title></refentryinfo>
<refmeta>
<refentrytitle>evalstr</refentrytitle>
</refmeta>
<refnamediv>
<refname>evalstr</refname>
<refpurpose>
Evalstrs evaluates a string containing Csound code, returning a value.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<para>
Evalstr compiles and runs Csound code and returns a value from the global space (instr 0). This opcode can be
also used to compile new instruments (as compilestr).
</para>
</refsect1>
<refsect1>
<title>Syntax</title>
<synopsis>ires <command>evalstr</command> Scode </synopsis>
<synopsis>kres <command>evalstr</command> Scode, ktrig </synopsis>
</refsect1>
<refsect1>
<title>Initialization</title>
<para>
<emphasis><quote>Scode</quote></emphasis> -- a string to be compiled and evaluated.
</para>
</refsect1>
<refsect1>
<title>Performance</title>
<para>
<emphasis><quote>ktrig</quote></emphasis> -- triggers the compilation/evaluation if non-zero.
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
Here is an example of the evalstr opcode in conjunction with return:
<example>
<para>
<programlisting>
ival <emphasis role="op">evalstr</emphasis> "return 2 + 2"
<emphasis role="op">print</emphasis> ival
</programlisting>
</para>
</example>
</para>
</refsect1>
<refsect1>
<title>Credits</title>
<para>Author: &namevictor;, 2013 </para>
</refsect1>
</refentry>
|