| View previous topic :: View next topic |
| Author |
Message |
bradleylauchlin Voice
Joined: 14 Apr 2008 Posts: 6
|
Posted: Mon Apr 21, 2008 8:24 pm Post subject: not detecting variable as array. [SOLVED] |
|
|
In one of my procs I do this:
set owner($chan) "$nick"
puthelp "NOTICE $nick :$owner($chan) is now the owner of $chan"
Then in another procedure I have this:
proc partchan {nick uhost hand chan {msg ""}} {
global owner
puthelp "NOTICE $nick :Leaving $chan whos owner is $owner($chan)."
When leaving the channel (bind triggers partchan) I get this in console:
[20:17] TCL error [partchan]: can't read "owner(#prem_vista)": variable isn't array
However, the first bit of code outputs correctly saying the correct username is the owner of the correct channel. So clearly the variable is an array there, and working. These are the only two snippets of code in which I even mention this variable.
Why does the second proc thing that it is not an array?
Thanks 
Last edited by bradleylauchlin on Mon Apr 21, 2008 10:50 pm; edited 1 time in total |
|
| Back to top |
|
 |
strikelight Owner

Joined: 07 Oct 2002 Posts: 708
|
Posted: Mon Apr 21, 2008 9:18 pm Post subject: |
|
|
| $owner is a global variable defined in your eggdrop's configuration file, which is not an array. Rename your array variable to something like "the_owner". |
|
| Back to top |
|
 |
bradleylauchlin Voice
Joined: 14 Apr 2008 Posts: 6
|
Posted: Mon Apr 21, 2008 10:50 pm Post subject: |
|
|
Thanks so much, that resolved it  |
|
| Back to top |
|
 |
|