Re: (newbie) calling a proc with a varying number of arguments
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: (newbie) calling a proc with a varying number of arguments

From: suchenwi <richard.suchenwirth-bauersachs@siemens.com>
Date: Tue Dec 20 2005 - 19:55:20 CET

Just call that argument "args" :D

proc try args {
   puts "I was called with [llength $args] arguments:"
   foreach arg $args {puts $arg}
}
(tmp) 59 % try
I was called with 0 arguments:
(tmp) 60 % try one
I was called with 1 arguments:
one
(tmp) 61 % try again with some more
I was called with 4 arguments:
again
with
some
more
Received on Fri Dec 23 19:02:35 2005