<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/15288" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2008-01-27T04:53:50-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/15288</id>

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2008-01-27T04:53:50-04:00</updated>

		<published>2008-01-27T04:53:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=80379#p80379</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=80379#p80379"/>
		<title type="html"><![CDATA[Depreciated or not depreciated?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=80379#p80379"><![CDATA[
The tcl 8.5 docu doesn't prefer either of the 2 possibilities. To quote the documentation:<blockquote class="uncited"><div>The then and else arguments are optional “noise words” to make the command easier to read.</div></blockquote>And I'd take that literally. They are meant to make code easier to read, that means either always use them or never. ^-^<br><div class="codebox"><p>Code: </p><pre><code>if {   $vbl == 1 || $vbl == 2 || $vbl == 3} then {   puts "vbl is one, two or three"}</code></pre></div>Is imho a really really bad idea, because the eye catchs<div class="codebox"><p>Code: </p><pre><code>if {} {   $vbl == 1 || $vbl == 2 || $vbl == 3} else {   puts "vbl is one, two or three"}</code></pre></div>which isn't meant at all. I'd suggest to write something like the following:<div class="codebox"><p>Code: </p><pre><code>if {$vbl == 1 || $vbl == 2      || $vbl == 3} {   puts "vbl is one, two or three"}</code></pre></div>I split the line, because I wanted to start the 2nd line of the condition with a || or &amp;&amp; to don't make the impression of just wrong indention. This follows a often used rule to use the double indention for multiple line for a single command.<br><br>PS: I personally would always use else, unless you want to write some quick code which just works but doesn't have to be maintained.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun Jan 27, 2008 4:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2008-01-26T10:12:00-04:00</updated>

		<published>2008-01-26T10:12:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=80354#p80354</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=80354#p80354"/>
		<title type="html"><![CDATA[Depreciated or not depreciated?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=80354#p80354"><![CDATA[
Thank you both for that information; very much appreciated. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>I was up until the wee small hours trying to find any reference to this and all to no avail.<br><br>I am wary of any (authoritative) statement emanating from a Windows software company especially when it refers to an Open Source project (that I suspect they'd like to make closed source if they could).<br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Sat Jan 26, 2008 10:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-01-25T11:09:32-04:00</updated>

		<published>2008-01-25T11:09:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=80334#p80334</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=80334#p80334"/>
		<title type="html"><![CDATA[Depreciated or not depreciated?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=80334#p80334"><![CDATA[
If dropping "else" is deprecated, wouldn't the dropping of "then" also be deprecated?<br><br>Sofar, I have not read anything suggesting either being deprecated, with perhaps the exception of multiple-cases coding:<br><div class="codebox"><p>Code: </p><pre><code>if {$vbl == 1} then {   puts "vbl is one"} elseif {$vbl == 2} then {   puts "vbl is two"} else {   puts "vbl is other than one or two"}</code></pre></div>Here you can drop both "then" and "else" (but not "elseif"), but not the "elseif". Still not quite as saying dropping either is deprecated.<br><br>Also, this qoute from the 8.5.0 if manpage:<blockquote class="uncited"><div>Remember, expressions can be multi-line, but in that case it can be a good idea to use the optional then keyword for clarity:<br><div class="codebox"><p>Code: </p><pre><code>if {   $vbl == 1 || $vbl == 2 || $vbl == 3} then {   puts "vbl is one, two or three"}</code></pre></div></div></blockquote>Would suggest "then" and "else" are mainly intended to make the code more readable, and has no "syntax function"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Jan 25, 2008 11:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-01-25T10:51:51-04:00</updated>

		<published>2008-01-25T10:51:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=80332#p80332</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=80332#p80332"/>
		<title type="html"><![CDATA[Depreciated or not depreciated?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=80332#p80332"><![CDATA[
I have seen nothing that indicates the code is depreciated. As long as it works (with it does), I wouldn't worry about it. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Fri Jan 25, 2008 10:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2008-01-25T09:56:15-04:00</updated>

		<published>2008-01-25T09:56:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=80331#p80331</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=80331#p80331"/>
		<title type="html"><![CDATA[Depreciated or not depreciated?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=80331#p80331"><![CDATA[
Just a question (after a meaningful discussion) based on a friend's faith in Komodo (Windows syntax thingie).<br><br>Anyway.... according to Komodo the following is "depreciated":<div class="codebox"><p>Code: </p><pre><code>if {$vbl == 1} {   puts "vbl is one"} {   puts "vbl is not one"}</code></pre></div>I personally prefer the above to the following (according to Komodo) current (non-depreciated code):<br><div class="codebox"><p>Code: </p><pre><code>if {$vbl == 1} {   puts "vbl is one"} else {   puts "vbl is not one"}</code></pre></div>The purpose of this post is to determine if the first example is indeed depreciated (as the Komodo user believes) as I cannot find one piece of documentation actually stating this.<br><br>Any input is (as always) gratefully accepted. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Fri Jan 25, 2008 9:56 am</p><hr />
]]></content>
	</entry>
	</feed>
