I want to make a tcl procedure that can take N number of arguments. And I want to call it from a bat file.
This is the procedure I wrote:
proc multi_argu {args} {
foreach {path rev_start rev_end} $args {
puts "path-> $path"
puts "rev_start-> $rev_start"
puts "rev_end-> $rev_end"
}
}
multi_argu $argv
Now I call it from my bat file as
tclsh multi_argu.tcl 1 2 3
But the out is
path-> 1 2 3
rev_start->
rev_end->
At the end of my tcl file, I am calling multi_argu $argv which I think is the culprit. However, I do not know how to do this step for multiple arguments. can anyone provide any input?