<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://sciwiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Inline_If_Statements</id>
	<title>Inline If Statements - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://sciwiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Inline_If_Statements"/>
	<link rel="alternate" type="text/html" href="http://sciwiki.sierrahelp.com/index.php?title=Inline_If_Statements&amp;action=history"/>
	<updated>2026-11-26T20:30:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>http://sciwiki.sierrahelp.com/index.php?title=Inline_If_Statements&amp;diff=277&amp;oldid=prev</id>
		<title>Andrew Branscom: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://sciwiki.sierrahelp.com/index.php?title=Inline_If_Statements&amp;diff=277&amp;oldid=prev"/>
		<updated>2013-08-05T21:16:27Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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 21:16, 5 August 2013&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key collectr_mwSCI-mw_:diff::1.12:old-276:rev-277 --&gt;
&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://sciwiki.sierrahelp.com/index.php?title=Inline_If_Statements&amp;diff=276&amp;oldid=prev</id>
		<title>Jeremiah Nellis at 15:08, 17 February 2012</title>
		<link rel="alternate" type="text/html" href="http://sciwiki.sierrahelp.com/index.php?title=Inline_If_Statements&amp;diff=276&amp;oldid=prev"/>
		<updated>2012-02-17T15:08:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;Note:  This article only applies to SCI Companion&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;if&amp;quot; statement does not return a value, making a the nesting of if&amp;#039;s (inline) like this not possible:&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;&lt;br /&gt;
(if (&amp;gt; a ((if(&amp;gt; b c) 5)(else 9)) d)     // This syntax works in SCI Studio, but will not compile in SCI Companion&lt;br /&gt;
  ...&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As indicated above, this code &amp;#039;&amp;#039;&amp;#039;will&amp;#039;&amp;#039;&amp;#039; work in Studio, but will not work in Companion.  The way to handle this in Companion is to implement a procedure, which will return a value:&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;&lt;br /&gt;
(procedure public (iif pCondition pTrue pFalse)&lt;br /&gt;
   (if (pCondition)&lt;br /&gt;
     return pTrue&lt;br /&gt;
   )(else &lt;br /&gt;
     return pFalse &lt;br /&gt;
   )&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The original statement can now be re-written as:&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot; class=&amp;quot;cs&amp;quot;&amp;gt;&lt;br /&gt;
(if (&amp;gt; a iif(&amp;gt; b c 5 9) d) &lt;br /&gt;
  ...&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Conditional Statements]]&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:Syntax]]&lt;/div&gt;</summary>
		<author><name>Jeremiah Nellis</name></author>
	</entry>
</feed>