Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-11-13
06:10 • Closed ticket [1065440fff]: proc - bind MSG - args - invalid. plus 9 other c... artifact: 0475974270 user: dgp
2004-11-12
21:18 • New ticket [1065440fff]. artifact: 11562835eb user: nobody

proc - bind MSG - args - invalid.

Closed / Invalid1065440fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-11-12 21:18:13
per docs at 
http://www.tcl.tk/man/tcl8.4/TclCmd/proc.htm

it states: "If the last formal argument has the name 
args, then a call to the procedure may contain more 
actual arguments than the procedure has formals"

This is a false statement if the proc is binded to a msg.  
It only will work if it is "arg" not "args".  

in a real example:

bind msg -|- !test test

proc test { nick host hand args } {
        
            set myvar1 [lindex $args 0]
            set myvar2 [lindex $args 1]
            set myvar3 [lindex $args 2]
            puthelp "PRIVMSG $nick :myvar1=$myvar1 
myvar2=$myvar2 myvar3=$myvar3"
}

when attached to eggdrop, i receive this.

[14:14] <nick> !test testing this script
[14:14] <eggdrop> myvar1=testing this script myvar2= 
myvar3=

if i change the script to:

bind msg -|- !test test

proc test { nick host hand arg } {
        
            set myvar1 [lindex $arg 0]
            set myvar2 [lindex $arg 1]
            set myvar3 [lindex $arg 2]
            puthelp "PRIVMSG $nick :myvar1=$myvar1 
myvar2=$myvar2 myvar3=$myvar3"
}

I receive this.

[14:18] <nick> !test testing this script
[14:18] <eggdrop> myvar1=testing myvar2=this 
myvar3=script

contact info [email protected]
dgpplain2004-11-13 06:10:45
Logged In: YES 
user_id=80530


this is very likely a bug/misfeature
in eggdrop rather than in Tcl.

If either you or the eggdrop authors
can point with greater specificity
to an error in Tcl's public interface,
we can look into it, but without that
it's prudent to assume that the eggdrop
application is where your problems lie.
Log in (anonymous is fine) to add a comment.