Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0fcb90c74804315a655fc00bb5a246c52409a99f
Ticket: 1065452fffffffffffffffffffffffffffffffff
proc - bind MSG - args - invalid.
User & Date: nobody on 2004-11-12 21:34:31
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    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]
    
  4. foundin changed to: "obsolete: 8.4.7"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "18. Commands M-Z"
  10. title changed to: "proc - bind MSG - args - invalid."
  11. type changed to: "Bug"