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

	<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-07-22T20:52:48-04:00</updated>

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

		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-22T20:52:48-04:00</updated>

		<published>2004-07-22T20:52:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38980#p38980</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38980#p38980"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38980#p38980"><![CDATA[
Umm....... thanks I'll give it a go.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <br>Though I use this one, works fine for me.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"> <br><div class="codebox"><p>Code: </p><pre><code>set newlist [list]foreach user $mylist { if {(![string equal -nocase $botnick $user])} { lappend newlist $user }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Thu Jul 22, 2004 8:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2004-07-22T13:16:24-04:00</updated>

		<published>2004-07-22T13:16:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38970#p38970</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38970#p38970"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38970#p38970"><![CDATA[
edit: mmh... not sure about removing multiple items, but this is the code is use for deleting single items:<div class="codebox"><p>Code: </p><pre><code>set newlist [lreplace $list $pos $pos]</code></pre></div>where $list is your existing list and $pos is the position (you get by using "lsearch $item") of the item you want to delete.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Thu Jul 22, 2004 1:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-19T21:51:35-04:00</updated>

		<published>2004-07-19T21:51:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38860#p38860</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38860#p38860"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38860#p38860"><![CDATA[
Hmm.. I don't know about the code I posted in my previous thread on this topic. But I came up with another one:<br><div class="codebox"><p>Code: </p><pre><code>set newlist [list]foreach user $mylist { if {([lsearch -exact [string tolower $user] [string tolower $botnick]] == -1)} { lappend newlist $user }}</code></pre></div>I think this would give the same purpose, if not right?<br>It will make a new list, exempting the variable I have defined  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_confused.gif" width="15" height="15" alt=":-?" title="Confused"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jul 19, 2004 9:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-19T15:50:27-04:00</updated>

		<published>2004-07-19T15:50:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38840#p38840</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38840#p38840"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38840#p38840"><![CDATA[
Hi, I have a small question related to lists.<br>How can we delete an element from a list?<br><br>Searching through the tcl manual with relation to lists, I've found a function which I think would do it.<br><div class="codebox"><p>Code: </p><pre><code>set newlist [lreplace $mylist 0 end "$botnick" ""]</code></pre></div>Would this be ok? Will it delete and element named '$botnick' (the bots nickname) from the list $mylist. If not, please let me know, if any other function is availiable to remove/delete a particular element from a list.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jul 19, 2004 3:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-18T13:56:21-04:00</updated>

		<published>2004-07-18T13:56:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38765#p38765</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38765#p38765"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38765#p38765"><![CDATA[
Na its... okay I got the hang of lsort and its switches.<br><br>I have looked at the manual. I have it all on my hddisk<br>for reference, thats the first thing I did before I tried<br>to do tcl scripting.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Jul 18, 2004 1:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arcane]]></name></author>
		<updated>2004-07-18T06:11:04-04:00</updated>

		<published>2004-07-18T06:11:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38751#p38751</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38751#p38751"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38751#p38751"><![CDATA[
maybe you should take a look at <a href="http://www.tcl.tk/man/tcl8.4/TclCmd/lsort.htm" class="postlink">http://www.tcl.tk/man/tcl8.4/TclCmd/lsort.htm</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2617">arcane</a> — Sun Jul 18, 2004 6:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-17T16:24:51-04:00</updated>

		<published>2004-07-17T16:24:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38727#p38727</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38727#p38727"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38727#p38727"><![CDATA[
Um.... ok so we can use -increasing -decreasing as well... I only thought -dictionary.<br><br>Yeah, I don't know whats the problem with chanbans can't get the accurate listning hmmm. I am using DALnet, maybe some problem with the IRCd or could be the raw display or something. I'll try to check it out.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sat Jul 17, 2004 4:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2004-07-17T16:07:36-04:00</updated>

		<published>2004-07-17T16:07:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38725#p38725</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38725#p38725"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38725#p38725"><![CDATA[
Try <strong class="text-strong">lsort -decreasing $list</strong><br><br><strong class="text-strong">llength [chanbans $chan]</strong> seems to work just fine, gives me the correct number of bans everytime..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sat Jul 17, 2004 4:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-17T15:52:36-04:00</updated>

		<published>2004-07-17T15:52:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38723#p38723</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38723#p38723"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38723#p38723"><![CDATA[
One more small question, regarding this topic.<br><br>The <strong class="text-strong">lsort -dictionary</strong> sorts using the dictionary rule alphabetically from A to Z.<br><br>When I do [chanlist $chan] I get a random output as well, then I use lsort to sort it out.<br><br>But how can I make it in a reverse way (the other way around). For example from "z**** y**** x**** ....... c**** b***** a****), rather than using "a b c .... x y z". The inverse!<br><br>How would the lsort be used to sort indexes using the dictionary in the inverse way alphabetically? From Z to A (reverse sequence)<br><br><br>****<br>Another small question. I have a script detecting the total number of bans in a banlist. Which can be found by <strong class="text-strong">[llength [chanbans $chan]]</strong>. However I am not getting the correct result. Always I get 1 less ban. If there are 5 bans in the channel's banlist, I get 4 bans. If there is 1 ban in the channel's banlist I get a null result.<br><br>I don't know what is wrong. This is quite a simple procedure? Is it because maybe of the lindex $var 0, index 0? in the list? Please help me.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sat Jul 17, 2004 3:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-13T05:01:09-04:00</updated>

		<published>2004-07-13T05:01:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38538#p38538</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38538#p38538"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38538#p38538"><![CDATA[
Geee... Thanx...  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing">  for the detailed info Papillion I appreciate it.<br>I'm more clearler in this concept now, I'll try to lookup and read<br>the manual and other references on these topics as well.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_cool.gif" width="15" height="15" alt="8)" title="Cool"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Tue Jul 13, 2004 5:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2004-07-13T02:56:09-04:00</updated>

		<published>2004-07-13T02:56:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38528#p38528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38528#p38528"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38528#p38528"><![CDATA[
to make the lsort sort alphabetically use the -dictionary command.<div class="codebox"><p>Code: </p><pre><code>lsort -dict $mylist</code></pre></div><em class="text-italics">lsearch</em> and <em class="text-italics">string match</em> both use the same sort of matching as default, but lsearch can also do matching with the re_syntax (used by regexp and regsub)<br>string commands are designed to be used on... strings <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>lsearch on lists<br>string match just returns 1 or 0 on match or no match<br>while lsearch returns -1 on no match or the index of first hit on match (unless you set -all or -inline or something like that to the option)<br>read more about it <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/lsearch.htm" class="postlink">here</a><br><br>... hope it makes abit more sence now <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Tue Jul 13, 2004 2:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2004-07-12T22:03:41-04:00</updated>

		<published>2004-07-12T22:03:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38519#p38519</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38519#p38519"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38519#p38519"><![CDATA[
'lsort' should do the job.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Mon Jul 12, 2004 10:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-12T21:47:26-04:00</updated>

		<published>2004-07-12T21:47:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38518#p38518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38518#p38518"/>
		<title type="html"><![CDATA[Need help with list sorting (lsort).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38518#p38518"><![CDATA[
Can anyone here help me out on a basic thing.<br><br>I am wanting to sort a list alphabetically.<br><br>Example:<div class="codebox"><p>Code: </p><pre><code>set mylist "benny alan ryan sarah rosey arnold adrian jessica"</code></pre></div>Which should give an output like sorting them aplhabetically:<br><div class="codebox"><p>Code: </p><pre><code>set mylist "adrian alan arnold benny jessica rosey ryan sarah"</code></pre></div>So the names are sorted alphabetically in the list.<br><br>And one more, question.<br><br>What is the difference between 'lsearch' and 'string match'?<br>They both give the same type of matching procedure is it?<br>I am not clear with lsearch, I know about string match though.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Mon Jul 12, 2004 9:47 pm</p><hr />
]]></content>
	</entry>
	</feed>
