| 1 | |
| 2 | <refentry id="else"> |
| 3 | <indexterm id="IndexElse"><primary>else</primary></indexterm> |
| 4 | <refentryinfo><title>Instrument Control:Program Flow Control</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>else</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>else</refname> |
| 13 | <refpurpose> |
| 14 | Executes a block of code when an "if...then" condition is false. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Executes a block of code when an "if...then" condition is false. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis><command>else</command></synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Performance</title> |
| 32 | <para> |
| 33 | <emphasis>else</emphasis> is used inside of a block of code between the <link linkend="if"><citetitle>"if...then"</citetitle></link> and <link linkend="endif"><citetitle>endif</citetitle></link> opcodes. It defines which statements are executed when a "if...then" condition is false. Only one <emphasis>else</emphasis> statement may occur and it must be the last conditional statement before the <emphasis>endif</emphasis> opcode. |
| 34 | </para> |
| 35 | </refsect1> |
| 36 | |
| 37 | <refsect1> |
| 38 | <title>Examples</title> |
| 39 | <para> |
| 40 | Here is an example of the else opcode. It uses the file <ulink url="examples/else.csd"><citetitle>else.csd</citetitle></ulink>. |
| 41 | <example> |
| 42 | <title>Example of the else opcode.</title> |
| 43 | <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> |
| 44 | <xi:include href="examples-xml/else.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 45 | </example> |
| 46 | </para> |
| 47 | </refsect1> |
| 48 | |
| 49 | <refsect1> |
| 50 | <title>See also</title> |
| 51 | <para><link linkend="ControlPgmctl"><citetitle>Program Flow Control</citetitle></link></para> |
| 52 | <para> More information on this opcode: <ulink url="http://www.csoundjournal.com/2006spring/controlFlow.html"><citetitle>http://www.csoundjournal.com/2006spring/controlFlow.html</citetitle></ulink> , written by Steven Yi </para> |
| 53 | </refsect1> |
| 54 | |
| 55 | |
| 56 | <refsect1> |
| 57 | <title>Credits</title> |
| 58 | <para>New in version 4.21</para> |
| 59 | </refsect1> |
| 60 | </refentry> |