This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
J
Jas321
Post
by Jas321 » Mon Aug 11, 2003 12:29 pm
I searched the forum, but couldnt find an specific answer for my problem. This use to work, but doesnt seem to work anymore.
In the script I would do:
proc myproc {} {
global botnick settings
foreach c [channels] {
set settings($c) "0"
}
}
However, now it just comes back with:
can't read "settings(#mychan)": no such variable
Thanks
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Mon Aug 11, 2003 2:36 pm
Are your names in the proper case? You should use [string tolower $c] in the array to be sure. Also why not do ".tcl array names settings" and see what's in there.
z_one
Master
Posts: 269 Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada
Post
by z_one » Mon Aug 11, 2003 3:48 pm
At the risk of repeating what stdragon said, since he said it first
I agree with him 100% because I had the same problem, and this is how I solved it.
Code: Select all
proc myproc {} {
global botnick settings
foreach c [channels] {
set settings([string tolower $c]) "0"
}
}
and in the other procedure where you use
settings($chan)
put this line immediately after the global declaration (if any)
So now both your array references match since they are forced to lower case.
rolandguy
Voice
Posts: 25 Joined: Wed Aug 13, 2003 1:50 pm
Post
by rolandguy » Fri Aug 15, 2003 5:08 am
are you sure that the error is coming from that proc? shouldnt get that error unless reading the var :/
roland