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

	<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>2004-01-09T10:00:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2004-01-09T10:00:29-04:00</updated>

		<published>2004-01-09T10:00:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32364#p32364</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32364#p32364"/>
		<title type="html"><![CDATA[Lappend removes &quot;\&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32364#p32364"><![CDATA[
Thank you, I removed the string map and added it while checking (since in the file they have the "\"; i.e. \[bla\]) and it works perfectly now.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Jan 09, 2004 10:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-01-08T14:37:30-04:00</updated>

		<published>2004-01-08T14:37:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32343#p32343</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32343#p32343"/>
		<title type="html"><![CDATA[Lappend removes &quot;\&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32343#p32343"><![CDATA[
Most likely the culprit is your unneccessary string map...<br>Try setting spnick directly to arg and see how that goes.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Thu Jan 08, 2004 2:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2004-01-08T14:12:43-04:00</updated>

		<published>2004-01-08T14:12:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32341#p32341</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32341#p32341"/>
		<title type="html"><![CDATA[Lappend removes &quot;\&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32341#p32341"><![CDATA[
I've just realized that it doesn't matter whether its $var or ${var} sorry for the mistake, my problem seems to be something else (I was testing it directly on "lappend list \[this\]" instead of $var).<br><br>I have a code to remove nicks from a file, but nicks with \ don't seem to be deleted, Here's the code:<div class="codebox"><p>Code: </p><pre><code>proc spn:rem {hand idx arg} {  global spnfile spf  if {$arg == ""} { return 0 }  set spnick "[string map {\\ \\\\ \[ \\\[ \] \\\]} $arg]"## exists:spnick checks if $spnick exists in file and set spf to 1 if found.  exists:spnick $spnick  if {$spf == "1"} {    set list ""    set file [open $spnfile r]    while {![eof $file]} {      set nick [gets $file]      if {![string equal -nocase $nick $spnick]} { lappend list $nick }    }    close $file    set ofile [open $spnfile w]    foreach snick $list {      if {$snick != ""} { puts $ofile $snick }    }    close $ofile    putlog "$spnick was deleted."  } else {    putlog "$spnick doesn't exist."  } }</code></pre></div>So what seems to be the problem ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Jan 08, 2004 2:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2004-01-08T13:47:45-04:00</updated>

		<published>2004-01-08T13:47:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32340#p32340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32340#p32340"/>
		<title type="html"><![CDATA[Lappend removes &quot;\&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32340#p32340"><![CDATA[
Thank you strikelight <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> I had a feeling that you are the one who's going to reply on this <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> I don't know why (although we haven't seen you around lately)<br><br>if variable contains for example \[this\] then using: lappend list ${variable} will insert \[this\] into the list <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Thanx again.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Jan 08, 2004 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[strikelight]]></name></author>
		<updated>2004-01-08T13:22:44-04:00</updated>

		<published>2004-01-08T13:22:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32336#p32336</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32336#p32336"/>
		<title type="html"><![CDATA[Lappend removes &quot;\&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32336#p32336"><![CDATA[
The problem is, is that all you are doing is escaping the []'s, which tells tcl that you actually mean []'s and not command substitution.<br><br>Use:<br><br>lappend variable {\[test\]}<br><br>As the {}'s tell TCL you won't be using command substitution.<br><br>(Note: Similarly, if setting a variable, set it as such: set variable {\[test\]})<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2005">strikelight</a> — Thu Jan 08, 2004 1:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2004-01-08T11:30:44-04:00</updated>

		<published>2004-01-08T11:30:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=32331#p32331</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=32331#p32331"/>
		<title type="html"><![CDATA[Lappend removes &quot;\&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=32331#p32331"><![CDATA[
When executing "<strong class="text-strong">lappend list \[something\]</strong>" it will be added to <strong class="text-strong">list</strong> as <strong class="text-strong">[something]</strong> instead of <strong class="text-strong">\[something\]</strong> as I want it.<br><br>Can anyone code a "string map" or "regexp" which would convert <strong class="text-strong">\[something\]</strong> to <strong class="text-strong">\\\[something\\\]</strong> ? so when "<strong class="text-strong">lappend list \\\[something\\\]</strong>" is executed, <strong class="text-strong">\[something\]</strong> will be added to list.<br><br>I Hope I was clear enough, and note that <strong class="text-strong">\[something\]</strong> would be in a var (ofourse, that's why I need the "string map" or "regexp" <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> )<br><br>Thank You <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=3085">Sir_Fz</a> — Thu Jan 08, 2004 11:30 am</p><hr />
]]></content>
	</entry>
	</feed>
