Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong Number of Args

Status
Not open for further replies.

b0ne

Technical User
Jul 24, 2006
2
US
Hello all. I am new to TCL and am wanting to get started. I've got some experience with VB and a few other programming languages / scripts. I've recently took on TCL and was going to write what I thought would be a simple TCL to do a chat command that is like !reg and the bot regs it's self, and !ident and the bot idents it's self.. I want to paste some code in here and see if someone can tell me why it's giving me "wrong number of args" error.
BEGIN PASTE
set NSPW "EDITME"
set NSEmail "EDITED@TCL.Testing.com"
bind pub n !reg DoRegNow
bind pub n !ident DoIdentNow
proc DoRegNow {} {
putserv "PRIVMSG NickServ :Register $NSPW $NSEmail"
}
proc DoIdentNow {} {
putserv "PRIVMSG NickServ :Ident $NSPW"
}
END PASTE
Help would be greatly appreciated.
 
Forgot to paste the error msg...
Tcl error [DoRegNow]: wrong # args: should be "DoRegNow
 
I can't see from what you've posted why you're getting "wrong # args". Is it possible the source is somewhere else in your script?

On the other hand, there is an error I can see:
you set (and thereby declare) the variables, NSPW, and NSEmail, outside of the proc's (that is, in the global scope). Your proc's cannot see them unless you declare them as global in each of DoRegNow and DoIdentNow.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top