| View previous topic :: View next topic |
| Author |
Message |
bsdkid Voice
Joined: 02 Nov 2005 Posts: 16
|
Posted: Wed Dec 07, 2005 1:18 pm Post subject: memory leak |
|
|
problem solved. thanks guys!
Last edited by bsdkid on Sun Dec 11, 2005 12:12 am; edited 2 times in total |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Dec 07, 2005 3:01 pm Post subject: |
|
|
I don't see anything that should cause a memory leak.
for only 1 team per nick, you should do a lsearch for the nick in the array like:
lsearch -exact [array get ::team] $n
PS: reading the rest of the srcipt and the TCL manual is everything you need to know to insert that code. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Dec 07, 2005 7:53 pm Post subject: |
|
|
I'm fascinated as to how one who is apparently ignorant of Tcl could determine there was even a "memory leak".  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Last edited by Alchera on Thu Dec 08, 2005 12:03 am; edited 1 time in total |
|
| Back to top |
|
 |
bsdkid Voice
Joined: 02 Nov 2005 Posts: 16
|
Posted: Wed Dec 07, 2005 10:28 pm Post subject: |
|
|
| Thank you De Kus! |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Wed Dec 07, 2005 10:57 pm Post subject: |
|
|
i dont exactly know if it will work on teams with more than 1 nick. I dont have the time to check exactly how array get will look like. you could use -glob and *$n* instead than, but that might lead into wrong matchs again . making it absolutely misstake proof you would probably need to lsearch the sublist in a foreach loop . _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
bsdkid Voice
Joined: 02 Nov 2005 Posts: 16
|
Posted: Thu Dec 08, 2005 3:12 pm Post subject: |
|
|
| hey man, how do i remove nick in team array? |
|
| Back to top |
|
 |
Ofloo Owner
Joined: 13 May 2003 Posts: 953 Location: Belguim
|
Posted: Fri Dec 09, 2005 4:06 pm Post subject: |
|
|
try array unset _________________ XplaiN but think of me as stupid |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Fri Dec 09, 2005 4:50 pm Post subject: |
|
|
thats not what he is looking for.
thats how far we got yesterday:
| Code: | Dez 09 04:58:26 EvilMan set refresh [lsearch [array get ::team] $nick]
Dez 09 04:58:28 EvilMan set a [array get ::team]
Dez 09 04:58:28 EvilMan set remove [lsearch -all -inline -glob [lindex $a $refresh] *$nick*]
Dez 09 04:58:28 EvilMan set ::team([lindex $a [expr {$refresh - 1}]) [lreplace [lindex $a $refresh] $remove $remove]]
Dez 09 05:00:38 De_Kus dont use -all and -inline ^-^
Dez 09 05:01:34 EvilMan Tcl error [partteam]: bad index "0)": must be integer or end?-integer?
Dez 09 05:02:46 De_Kus have you a close brake behind the lsearch statement? :P
Dez 09 05:03:25 EvilMan set remove [lsearch -glob [lindex $a $refresh] *$nick*]
Dez 09 05:04:08 De_Kus look at the completet error, maybe you are missing something again :D
Dez 09 05:04:47 EvilMan Currently: bad index "0)": must be integer or end?-integer?
Dez 09 05:04:47 EvilMan Currently: while executing
Dez 09 05:04:47 EvilMan Currently: "lindex $a [expr {$refresh - 1}]) [lreplace [lindex $a $refresh] $remove $remove]"
Dez 09 05:04:47 EvilMan Currently: (procedure "partteam" line 9)
Dez 09 05:04:47 EvilMan Currently: invoked from within
Dez 09 05:04:48 EvilMan Currently: "partteam $_pub1 $_pub2 $_pub3 $_pub4 $_pub5" |
_________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
|