<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Ternary Operators in VBScript</title>
	<link>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/</link>
	<description>Ask the Windows Guru!</description>
	<pubDate>Sat, 04 Feb 2012 12:01:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Nilpo</title>
		<link>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-84441</link>
		<dc:creator>Nilpo</dc:creator>
		<pubDate>Tue, 13 Apr 2010 20:12:02 +0000</pubDate>
		<guid>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-84441</guid>
		<description>Hi JeffH,

Your code works fine, but it really defeats the purpose of a ternary operator (which is to avoid having drawn out structures).  Not only that, but the implementation of your function makes readability extremely difficult as well.</description>
		<content:encoded><![CDATA[<p>Hi JeffH,</p>
<p>Your code works fine, but it really defeats the purpose of a ternary operator (which is to avoid having drawn out structures).  Not only that, but the implementation of your function makes readability extremely difficult as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JeffH</title>
		<link>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-84423</link>
		<dc:creator>JeffH</dc:creator>
		<pubDate>Tue, 13 Apr 2010 14:49:14 +0000</pubDate>
		<guid>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-84423</guid>
		<description>my 2 cents.

as far as I've been able to tell, you have to kludge it up in vbScript.

Along the lines of (tested for basic cases, but obviously not foolprofed):

function ternary( boolVal, trueVal, falseVal )
   if ( boolVal ) then
      ternary = trueVal
   else
      ternary = falseVal
   end if
end function

strResult = ternary((theVal="0" or theVal="-1"),"zero or neg 1", "positive")</description>
		<content:encoded><![CDATA[<p>my 2 cents.</p>
<p>as far as I&#8217;ve been able to tell, you have to kludge it up in vbScript.</p>
<p>Along the lines of (tested for basic cases, but obviously not foolprofed):</p>
<p>function ternary( boolVal, trueVal, falseVal )<br />
   if ( boolVal ) then<br />
      ternary = trueVal<br />
   else<br />
      ternary = falseVal<br />
   end if<br />
end function</p>
<p>strResult = ternary((theVal=&#8221;0&#8243; or theVal=&#8221;-1&#8243;),&#8221;zero or neg 1&#8243;, &#8220;positive&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilpo</title>
		<link>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-60802</link>
		<dc:creator>Nilpo</dc:creator>
		<pubDate>Fri, 11 Sep 2009 00:41:00 +0000</pubDate>
		<guid>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-60802</guid>
		<description>Thanks, Sandra.  I appreciate your kind words.</description>
		<content:encoded><![CDATA[<p>Thanks, Sandra.  I appreciate your kind words.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandrar</title>
		<link>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-60794</link>
		<dc:creator>sandrar</dc:creator>
		<pubDate>Thu, 10 Sep 2009 22:26:28 +0000</pubDate>
		<guid>http://www.nilpo.com/2008/01/windows-scripting/ternary-operators-in-vbscript/#comment-60794</guid>
		<description>Hi! I was surfing and found your blog post... nice! I love your blog.  :) Cheers! Sandra. R.</description>
		<content:encoded><![CDATA[<p>Hi! I was surfing and found your blog post&#8230; nice! I love your blog.  <img src='http://www.nilpo.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Cheers! Sandra. R.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

