<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?action=history&amp;feed=atom&amp;title=Programmer_Guide%2FCommand_Reference%2FCOND</id>
	<title>Programmer Guide/Command Reference/COND - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?action=history&amp;feed=atom&amp;title=Programmer_Guide%2FCommand_Reference%2FCOND"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;action=history"/>
	<updated>2026-05-06T21:40:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=6551&amp;oldid=prev</id>
		<title>Christian: /* Usage */</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=6551&amp;oldid=prev"/>
		<updated>2014-04-24T14:26:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:26, 24 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;. If no target is specified, a conditional execution is performed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;. If no target is specified, a conditional execution is performed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:*&lt;/del&gt;Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&#039;$#a&#039;==&#039;7&#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&#039;$#a&#039;==&#039;7&#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the first command &amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the first command &amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=6550&amp;oldid=prev</id>
		<title>Christian: /* Usage */</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=6550&amp;oldid=prev"/>
		<updated>2014-04-24T14:25:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:25, 24 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command performs a conditional assignment.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command performs a conditional assignment.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;&lt;/del&gt;[ &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; := ] COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;gt;&amp;lt;/code&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;[ &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; := ] COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;. If no target is specified, a conditional execution is performed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;. If no target is specified, a conditional execution is performed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr1&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr2&lt;/del&gt;&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr1&lt;/del&gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr2&lt;/del&gt;&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the first command &amp;lt;var&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr1&lt;/del&gt;&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr2&lt;/del&gt;&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;var&amp;gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;/ins&gt;&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;/ins&gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;/ins&gt;&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the first command &amp;lt;var&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;/ins&gt;&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expr&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;/ins&gt;&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4299&amp;oldid=prev</id>
		<title>Toni: /* Examples */</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4299&amp;oldid=prev"/>
		<updated>2011-04-27T13:52:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Examples&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:52, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l18&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #absdiff := cond $#a &amp;gt; $#b ? eval $#a-$#b : eval $#b-$#a   // absolute difference&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #absdiff := cond $#a &amp;gt; $#b ? eval $#a-$#b : eval $#b-$#a   // absolute difference&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #len := cond $(length $#a) &amp;gt; 0 ? length $#a : length $#b   // length of #a or, if empty, of #b&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #len := cond $(length $#a) &amp;gt; 0 ? length $#a : length $#b   // length of #a or, if empty, of #b&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; cond &#039;$#item[?]&#039; == table ? gosub useTable $#item : gosub useOtherItem $#item&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;See the file &amp;lt;code&amp;gt;conditional_assignment.sts&amp;lt;/code&amp;gt; for further working examples.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;See the file &amp;lt;code&amp;gt;conditional_assignment.sts&amp;lt;/code&amp;gt; for further working examples.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- C.G. 14.3.2011 --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- C.G. 14.3.2011 --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- A.N. 27.4.2011 --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- A.N. 27.4.2011 --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4298&amp;oldid=prev</id>
		<title>Toni at 13:47, 27 April 2011</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4298&amp;oldid=prev"/>
		<updated>2011-04-27T13:47:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:47, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr1&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;&lt;/del&gt;expr2&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the first command &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr1&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;expr2&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the first command &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4297&amp;oldid=prev</id>
		<title>Toni at 13:46, 27 April 2011</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4297&amp;oldid=prev"/>
		<updated>2011-04-27T13:46:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:46, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the value &lt;/del&gt;the first command &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any commands, with the only exception of all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the first command &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; will be executed, otherwise the second &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; is specified, the return value of the executed command is assigned.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4296&amp;oldid=prev</id>
		<title>Toni at 13:45, 27 April 2011</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4296&amp;oldid=prev"/>
		<updated>2011-04-27T13:45:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:45, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__NOTOC__&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command performs a conditional assignment.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command performs a conditional assignment.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;conditonal assignment with [[../EVAL|EVAL]], [[Programmer_Guide/Introduction#Control_Commands|control commands]], [[../IF|IF]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;conditonal assignment with [[../EVAL|EVAL]], [[Programmer_Guide/Introduction#Control_Commands|control commands]], [[../IF|IF]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;== Examples &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Examples==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #min := cond $#a &amp;lt; $#b ? $#a : $#b                         // calculate minimum of #a and #b&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #min := cond $#a &amp;lt; $#b ? $#a : $#b                         // calculate minimum of #a and #b&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #abs := cond $#a &amp;lt; 0 ? num -$#a : $#a                      // calculate absolute value of #a&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #abs := cond $#a &amp;lt; 0 ? num -$#a : $#a                      // calculate absolute value of #a&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4295&amp;oldid=prev</id>
		<title>Toni at 13:45, 27 April 2011</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4295&amp;oldid=prev"/>
		<updated>2011-04-27T13:45:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:45, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expressions that may be normally used in an assignment&lt;/del&gt;, with the only exception all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the value &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;determined by &lt;/del&gt;the first &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expression, &lt;/del&gt;&amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;will be &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;assigned to &amp;lt;code&amp;gt;&#039;&#039;target&#039;&#039;&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; evaluates to falsehood&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;it will be &lt;/del&gt;the second &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;expression, &lt;/del&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;expr2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, that gets assigned to target&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;commands&lt;/ins&gt;, with the only exception &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;of &lt;/ins&gt;all control commands. If, at runtime, the conditional expression &amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt; evaluates to truth, the value the first &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;command &lt;/ins&gt;&amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; will be &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;executed&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;otherwise &lt;/ins&gt;the second &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;expr2&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If &lt;/ins&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;target&lt;/ins&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;is specified, &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;return value &lt;/ins&gt;of the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;executed command &lt;/ins&gt;is &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;assigned&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Notes==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You may use any {{STX}} [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] you like for &lt;/del&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;condition&#039;&#039;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;with &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;exception &lt;/del&gt;of &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;conditions themselves containing &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; keyword. Equally, there &lt;/del&gt;is &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;no restriction on &amp;lt;code&amp;gt;&#039;&#039;expr1&#039;&#039;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&#039;&#039;expr2&#039;&#039;&amp;lt;/code&amp;gt;, except that they must not be built up from &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; expressions themselves, either. It is even (and also) possible to use inline function calls (&amp;lt;code&amp;gt;$(...)&amp;lt;/code&amp;gt;), nesting them as deeply as one feels inclined to&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;== Notes &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command is processed by the loader, and is therefore not available in the command line interface.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command may not contain a nested &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command may not contain a nested &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==See also==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;conditonal assignment with [[../EVAL|EVAL]], [[Programmer_Guide/Introduction#Control_Commands|control commands]], [[../IF|IF]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Examples ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Examples ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #min := cond $#a &amp;lt; $#b ? $#a : $#b                         // calculate minimum of #a and #b&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  #min := cond $#a &amp;lt; $#b ? $#a : $#b                         // calculate minimum of #a and #b&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l22&quot;&gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;See the file &amp;lt;code&amp;gt;conditional_assignment.sts&amp;lt;/code&amp;gt; for further working examples.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;See the file &amp;lt;code&amp;gt;conditional_assignment.sts&amp;lt;/code&amp;gt; for further working examples.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- C.G. 14.3.2011 --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;!-- C.G. 14.3.2011 --&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- A.N. 27.4.2011 --&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4294&amp;oldid=prev</id>
		<title>Toni at 13:39, 27 April 2011</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4294&amp;oldid=prev"/>
		<updated>2011-04-27T13:39:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:39, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;[ &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; := ] COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;[ &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; := ] COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;target&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;. If no target is specified, a conditional execution is performed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;target&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;. If no target is specified, a conditional execution is performed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;var&amp;gt;condition&amp;lt;/var&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::*Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;$#a&amp;#039;==&amp;#039;7&amp;#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;expr1&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt; and &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;expr2&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any expressions that may be normally used in an assignment, with the only exception &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;of a &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; expression (meaning that conditional assignments must not be nested for the time being)&lt;/del&gt;. If, at runtime, the conditional expression &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;condition&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt; evaluates to truth, the value determined by the first expression, &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;expr1&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;, will be assigned to &amp;lt;code&amp;gt;&#039;&#039;target&#039;&#039;&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; evaluates to falsehood, it will be the second expression, &amp;lt;code&amp;gt;&#039;&#039;expr2&#039;&#039;&amp;lt;/code&amp;gt;, that gets assigned to target.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;expr1&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt; and &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;expr2&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any expressions that may be normally used in an assignment, with the only exception &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;all control commands&lt;/ins&gt;. If, at runtime, the conditional expression &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;condition&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt; evaluates to truth, the value determined by the first expression, &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;expr1&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;, will be assigned to &amp;lt;code&amp;gt;&#039;&#039;target&#039;&#039;&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; evaluates to falsehood, it will be the second expression, &amp;lt;code&amp;gt;&#039;&#039;expr2&#039;&#039;&amp;lt;/code&amp;gt;, that gets assigned to target.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You may use any {{STX}} [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] you like for &amp;lt;code&amp;gt;&amp;#039;&amp;#039;condition&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; with the exception of conditions themselves containing the &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; keyword. Equally, there is no restriction on &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr2&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;, except that they must not be built up from &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; expressions themselves, either. It is even (and also) possible to use inline function calls (&amp;lt;code&amp;gt;$(...)&amp;lt;/code&amp;gt;), nesting them as deeply as one feels inclined to.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You may use any {{STX}} [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] you like for &amp;lt;code&amp;gt;&amp;#039;&amp;#039;condition&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; with the exception of conditions themselves containing the &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; keyword. Equally, there is no restriction on &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr2&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;, except that they must not be built up from &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; expressions themselves, either. It is even (and also) possible to use inline function calls (&amp;lt;code&amp;gt;$(...)&amp;lt;/code&amp;gt;), nesting them as deeply as one feels inclined to.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4293&amp;oldid=prev</id>
		<title>Toni at 13:35, 27 April 2011</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4293&amp;oldid=prev"/>
		<updated>2011-04-27T13:35:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:35, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;[ &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; := ] COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;[ &amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; := ] COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;target&amp;lt;/code&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. If no target is specified, a conditional execution is performed&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;target&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;&amp;lt;/code&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;condition&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;var&lt;/ins&gt;&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;condition&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/del&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/del&gt;&amp;gt;: is a [[Programmer_Guide/Introduction#Conditional_Expressions|conditional expression]] like used with the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference|IF]]&amp;lt;/code&amp;gt; statement and the miscellaneous conditional [[Programmer_Guide/Introduction#Control_Commands|control commands]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:*&lt;/ins&gt;Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&#039;$#a&#039;==&#039;7&#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:Note that with conditional {{STX}} expressions there must always be intervening whitespaces between operators and their arguments (unless the argument is quoted). So, both &amp;lt;code&amp;gt;$#a == 7&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&#039;$#a&#039;==&#039;7&#039;&amp;lt;/code&amp;gt; are valid expression, whereas &amp;lt;code&amp;gt;$#a==7&amp;lt;/code&amp;gt; is not.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr2&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any expressions that may be normally used in an assignment, with the only exception of a &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; expression (meaning that conditional assignments must not be nested for the time being). If, at runtime, the conditional expression &amp;lt;code&amp;gt;&amp;#039;&amp;#039;condition&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; evaluates to truth, the value determined by the first expression, &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;, will be assigned to &amp;lt;code&amp;gt;&amp;#039;&amp;#039;target&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; evaluates to falsehood, it will be the second expression, &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr2&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;, that gets assigned to target.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr2&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;: Both &amp;lt;code&amp;gt;expr1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;expr2&amp;lt;/code&amp;gt; may be any expressions that may be normally used in an assignment, with the only exception of a &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; expression (meaning that conditional assignments must not be nested for the time being). If, at runtime, the conditional expression &amp;lt;code&amp;gt;&amp;#039;&amp;#039;condition&amp;#039;&amp;#039;&amp;lt;/code&amp;gt; evaluates to truth, the value determined by the first expression, &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr1&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;, will be assigned to &amp;lt;code&amp;gt;&amp;#039;&amp;#039;target&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; evaluates to falsehood, it will be the second expression, &amp;lt;code&amp;gt;&amp;#039;&amp;#039;expr2&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;, that gets assigned to target.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4292&amp;oldid=prev</id>
		<title>Toni at 13:32, 27 April 2011</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/COND&amp;diff=4292&amp;oldid=prev"/>
		<updated>2011-04-27T13:32:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:32, 27 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command performs a conditional assignment.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;COND&amp;lt;/code&amp;gt; command performs a conditional assignment.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Usage==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{&lt;/del&gt;&amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; :=&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;} &lt;/del&gt;COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[ &lt;/ins&gt;&amp;lt;var&amp;gt;target&amp;lt;/var&amp;gt; := &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;] &lt;/ins&gt;COND [[Programmer_Guide/Introduction#Conditional_Expressions|condition]] ? &amp;lt;var&amp;gt;expr1&amp;lt;/var&amp;gt; : &amp;lt;var&amp;gt;expr2&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;code&amp;gt;&amp;#039;&amp;#039;target&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;&amp;lt;code&amp;gt;&amp;#039;&amp;#039;target&amp;#039;&amp;#039;&amp;lt;/code&amp;gt;: is a normal assignment target, usually the name of an {{STX}} variable, e.g. &amp;lt;code&amp;gt;#var&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Toni</name></author>
	</entry>
</feed>