egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

not detecting variable as array. [SOLVED]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
bradleylauchlin
Voice


Joined: 14 Apr 2008
Posts: 6

PostPosted: Mon Apr 21, 2008 8:24 pm    Post subject: not detecting variable as array. [SOLVED] Reply with quote

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 Smile


Last edited by bradleylauchlin on Mon Apr 21, 2008 10:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
strikelight
Owner


Joined: 07 Oct 2002
Posts: 708

PostPosted: Mon Apr 21, 2008 9:18 pm    Post subject: Reply with quote

$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
View user's profile Send private message Visit poster's website
bradleylauchlin
Voice


Joined: 14 Apr 2008
Posts: 6

PostPosted: Mon Apr 21, 2008 10:50 pm    Post subject: Reply with quote

Thanks so much, that resolved it Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber