<?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/20220" />

	<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>2016-09-29T18:27:49-04:00</updated>

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

		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-09-29T18:27:49-04:00</updated>

		<published>2016-09-29T18:27:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105477#p105477</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105477#p105477"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105477#p105477"><![CDATA[
<blockquote class="uncited"><div>...<br>Well, to put it correctly, the text string is not converted into a list, but inserted as a single list element into a list.<br><br>Simply put, the string "This Test" becomes "{This Test}", and [lindex "{This Test}" 0] returns the first list item being the string "This Test".</div></blockquote>ahh..   ok.<br>Very clear.<br><br>Thank you.<br><br>And I'm sure this will all help the original poster, when he returns.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Sep 29, 2016 6:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2016-09-29T18:23:47-04:00</updated>

		<published>2016-09-29T18:23:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105476#p105476</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105476#p105476"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105476#p105476"><![CDATA[
<blockquote class="uncited"><div>So when this bind that normally passes a text string does so, and hits the parameter named args in that place, it is converted on-the-fly from a string to a list?</div></blockquote>Well, to put it correctly, the text string is not converted into a list, but inserted as a single list element into a list.<br><br>Simply put, the string "This Test" becomes "{This Test}", and [lindex "{This Test}" 0] returns the first list item being the string "This Test".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Sep 29, 2016 6:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-09-29T18:02:52-04:00</updated>

		<published>2016-09-29T18:02:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105475#p105475</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105475#p105475"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105475#p105475"><![CDATA[
<blockquote class="uncited"><div>...<br>With that said, for those stumbling into this thread in search for information regarding list errors...<br>First of all, $args is actually a list. </div></blockquote>This is why I never use it, unless I mean to use it - and that is very rare.<br><br>I hate to see it, but I forced myself to leave it, since that is what it was originally.  To change it,  I would have had to explain why I changed it....<br>ugg...<br><br><blockquote class="uncited"><div>The reason is that having the last parameter in a proc declaration being named "args" makes it behave like varargs in other languages; that is, accept multiple number of arguments. Each argument will be added as a list item to $args.<br>Splitting $args makes absolutely no sense here.</div></blockquote>So when this bind that normally passes a text string does so, and hits the parameter named args in that place, it is converted on-the-fly from a string to a list?<br><br>Ok.. I didn't stop and even think about it at the time.  I just forced myself to go with his naming.<br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Sep 29, 2016 6:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2016-09-29T16:28:15-04:00</updated>

		<published>2016-09-29T16:28:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105474#p105474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105474#p105474"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105474#p105474"><![CDATA[
Be advised that we do not support piracy, and torrents tend to be synonymous with piracy these days:<br>From forum rules:<blockquote class="uncited"><div>No requesting help on anything involving "piracy" (of software, movies, or otherwise), because it's illegal in most places.</div></blockquote>With that said, for those stumbling into this thread in search for information regarding list errors...<br>First of all, $args is actually a list. The reason is that having the last parameter in a proc declaration being named "args" makes it behave like varargs in other languages; that is, accept multiple number of arguments. Each argument will be added as a list item to $args.<br>Splitting $args makes absolutely no sense here.<br><br>In virtually all cases I've seen, the first fault is that people use the name "args" without knowing it's special properties.<br>The second fault is that they "solve" it by using lindex to extract the first item, without actually knowing why they are doing it in the first place...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Sep 29, 2016 4:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-09-29T13:54:02-04:00</updated>

		<published>2016-09-29T13:54:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105473#p105473</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105473#p105473"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105473#p105473"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>return [isy:createtorrent $nick $host $hand $chan $arg] </code></pre></div></div></blockquote>I guess that <br>isy:createtorrent<br>is some proc that you have elsewhere.  We haven't seen what is in it.<br>We have to hope that it doesn't have errors in it.<br><br>I don't know about having the result returned by the return command being the return of yet another proc.   Maybe Spike knows if that is do-able.<br><br>What are you trying to do though? ... Why is the return command used like that?<br><br>I ask, because I'm wondering if you just want to run that other proc while passing those parameters to it.<br>If so,  forget the use of the return command.<br>Just :<div class="codebox"><p>Code: </p><pre><code>isy:createtorrent $nick $host $hand $chan $arg</code></pre></div>Think of <br>isy:createtorrent<br>as a new TCL command that you have created, and just use it.<br>(this assumes that it is a proc that is already loaded)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Sep 29, 2016 1:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-09-29T13:42:22-04:00</updated>

		<published>2016-09-29T13:42:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105472#p105472</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105472#p105472"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105472#p105472"><![CDATA[
Worth bookmarking and reading someday:<br><br><br><a href="http://web.archive.org/web/20070205113405/http://www.peterre.info/characters.html" class="postlink">http://web.archive.org/web/200702051134 ... cters.html</a><br><br><br>About just what we are are talking about above.<br><br>Also has help on using timers.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Sep 29, 2016 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2016-09-29T13:39:57-04:00</updated>

		<published>2016-09-29T13:39:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105471#p105471</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105471#p105471"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105471#p105471"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>set arg [lindex [lindex $args 0]] </code></pre></div></div></blockquote>$args is a string.<br>lindex works on lists.<br>You can "get away with it" sometimes, but it is not the right way to go about it.<br><br>Convert the string to a list, using <br>split<br><br>See:   <a href="http://www.tcl.tk/man/tcl8.6/TclCmd/split.htm" class="postlink">http://www.tcl.tk/man/tcl8.6/TclCmd/split.htm</a><br><div class="codebox"><p>Code: </p><pre><code>set arg [lindex [split $args] 0]</code></pre></div>if you want to get the first word in $args<br><br>I hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Thu Sep 29, 2016 1:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2016-09-29T13:23:11-04:00</updated>

		<published>2016-09-29T13:23:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105470#p105470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105470#p105470"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105470#p105470"><![CDATA[
What do you suggest i did read something about split but to be honest im not sure<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Thu Sep 29, 2016 1:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2016-09-29T13:16:33-04:00</updated>

		<published>2016-09-29T13:16:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105469#p105469</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105469#p105469"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105469#p105469"><![CDATA[
Problem's probably here...<div class="codebox"><p>Code: </p><pre><code>set arg [lindex [lindex $args 0]]</code></pre></div>Why do we lindex twice??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Thu Sep 29, 2016 1:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2016-09-29T12:43:50-04:00</updated>

		<published>2016-09-29T12:43:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=105468#p105468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=105468#p105468"/>
		<title type="html"><![CDATA[TCL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=105468#p105468"><![CDATA[
Hi guys struggling to get my script right i keep getting this error <br><br>[17:32:53] Tcl error [completeme]: list element in quotes followed by ":" instead of space<br><br>this is the proc<div class="codebox"><p>Code: </p><pre><code>proc completeme {bot com args} {set nick "User"set host "User@owner.irc.net"set hand "*"set chan "#somechan"set arg [lindex [lindex $args 0]]        return [isy:createtorrent $nick $host $hand $chan $arg]}</code></pre></div>and this is the bind<br><div class="codebox"><p>Code: </p><pre><code>bind bot - COMPLETE completeme</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Thu Sep 29, 2016 12:43 pm</p><hr />
]]></content>
	</entry>
	</feed>
