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

	<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>2003-01-26T01:05:07-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-01-26T01:05:07-04:00</updated>

		<published>2003-01-26T01:05:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15820#p15820</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15820#p15820"/>
		<title type="html"><![CDATA[set args [split $args]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15820#p15820"><![CDATA[
Cool thanx for the replys, gonna test it tomorrow <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> Now it is time for bed, it's 06:04 here, just finished working @ a local club... <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 Guest — Sun Jan 26, 2003 1:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-01-25T17:34:19-04:00</updated>

		<published>2003-01-25T17:34:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15805#p15805</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15805#p15805"/>
		<title type="html"><![CDATA[Re: set args [split $args]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15805#p15805"><![CDATA[
<blockquote class="uncited"><div>I have a msg bind. I want the user to do be able to use:<br><br>!invite user pass<br><br>Code:<br>set args [split $args]<br>set usr [lindex $args 0]<br>set pwd [lindex $args 1]<br><br>So i do:<br>!invite xces test<br><br>I get:<br>$usr = "{xces"<br>$pwd = "test}"<br><br>But i don't need the { and }... how do remove those?</div></blockquote>It is because of the special meaning of the word "args". (This question could be added to the FAQ on this forum).<br><br>If you have a proc that you want to call with a variable number of arguments, you can use the special reserved word "args".<br><div class="codebox"><p>Code: </p><pre><code># Proc definition using keywords "args"proc myproc { args } {   set arg0 [lindex $args 0]   set arg1 [lindex $args 1]   ...   ...}# call the proc with one argumentmyproc foo# call the proc with two argumentsmyproc foo bar</code></pre></div>In your particular case, there is only one argument: the string of text "xces test". To pass this string of text as a list (with one element) to your proc, Tcl embraces it. Thus you get: {xces test}. Then you apply a split command to it, with the result you have shown.<br><br>Easiest solution: Do not use the keyword "args", but use something different like "text" or "pubstring".<br><br>You can use "args" but then you must treat it as a list having one element: the line of text entered on the channel.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Sat Jan 25, 2003 5:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-01-25T17:25:15-04:00</updated>

		<published>2003-01-25T17:25:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15802#p15802</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15802#p15802"/>
		<title type="html"><![CDATA[set args [split $args]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15802#p15802"><![CDATA[
Do not use $args in the first place.<br><br>They have a special meaning in Tcl. Allow you to use unlumited length argument lists for procedures.<br><br>Simply changing any occurance of $args to $arg will normaly cure 99% of problems.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Jan 25, 2003 5:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-01-25T16:45:27-04:00</updated>

		<published>2003-01-25T16:45:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15798#p15798</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15798#p15798"/>
		<title type="html"><![CDATA[set args [split $args]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15798#p15798"><![CDATA[
I have a msg bind. I want the user to do be able to use:<br><br>!invite user pass<br><br>Code:<br>set args [split $args]<br>set usr [lindex $args 0]<br>set pwd [lindex $args 1]<br><br>So i do:<br>!invite xces test<br><br>I get:<br>$usr = "{xces"<br>$pwd = "test}"<br><br>But i don't need the { and }... how do remove those?<p>Statistics: Posted by Guest — Sat Jan 25, 2003 4:45 pm</p><hr />
]]></content>
	</entry>
	</feed>
