summaryrefslogtreecommitdiff
path: root/opcodes/stack.xml
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/stack.xml')
-rw-r--r--opcodes/stack.xml17
1 files changed, 16 insertions, 1 deletions
diff --git a/opcodes/stack.xml b/opcodes/stack.xml
index 41097f7..97a48c6 100644
--- a/opcodes/stack.xml
+++ b/opcodes/stack.xml
@@ -39,7 +39,7 @@
The global stack works in LIFO order: after multiple <link linkend="push"><citetitle>push</citetitle></link> calls, <link linkend="pop"><citetitle>pop</citetitle></link> should be used in reverse order.
</para>
<para>
- Each <link linkend="push"><citetitle>push</citetitle></link> or <link linkend="pop"><citetitle>pop</citetitle></link> operation can work on a "bundle" of multiple variables. When using <link linkend="pop"><citetitle>pop</citetitle></link>, the number, type, and order of items must match those used by the corresponding <link linkend="push"><citetitle>push</citetitle></link>. That is, after a 'push Sfoo, ibar', you must call something like 'pop Sbar, ifoo', and not e.g. two separate 'pop' statements.
+ Each <link linkend="push"><citetitle>push</citetitle></link> or <link linkend="pop"><citetitle>pop</citetitle></link> operation can work on a "bundle" of multiple variables. When using <link linkend="pop"><citetitle>pop</citetitle></link>, the number, type, and order of items must match those used by the corresponding <link linkend="push"><citetitle>push</citetitle></link>. That is, after a 'push Sfoo, ibar', you must call something like 'Sbar, ifoo pop', and not e.g. two separate 'pop' statements.
</para>
<para>
<link linkend="push"><citetitle>push</citetitle></link> and <link linkend="pop"><citetitle>pop</citetitle></link> opcodes can take variables of any type (i-, k-, a- and strings). Variables of type 'a' and 'k' are passed at performance time only, while 'i' and 'S' are passed at init time only.
@@ -51,6 +51,19 @@
Any stack errors (trying to push when there is no more space, or pop from an empty stack, inconsistent number or type of arguments, etc.) are fatal and terminate performance.
</para>
</refsect1>
+
+ <refsect1>
+ <title>Examples</title>
+ <para>
+ Here is an example of the stack opcode. It uses the file <ulink url="examples/stack.csd"><citetitle>stack.csd</citetitle></ulink>.
+ <example>
+ <title>Example of the stack opcode.</title>
+ <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para>
+ <xi:include href="examples-xml/stack.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1>
<title>See also</title>
<para>
@@ -59,7 +72,9 @@
<link linkend="pop_f"><citetitle>pop_f</citetitle></link> and
<link linkend="push_f"><citetitle>push_f</citetitle></link>.
</para>
+ <para>Using this opcode is somewhat hackish, as you can read here: <ulink url="http://csound.1045644.n5.nabble.com/passing-a-string-to-a-UDO-td1099284.html"></ulink></para>
</refsect1>
+
<refsect1>
<title>Credits</title>
<para>By: &nameistvan;.</para>