Tcl/Tk : Passing variable no. of arguments within tcl code

85 Views Asked by At
set newarg [join $argmnts " "] 
set msg [exec $fname arguments] 

Note : argmnts are not commandline arguments, it is from value_dialog_box

newarg is a list of arguments (no. of arguments may vary in newarg), fname is some file name. I want to pass these arguments (newarg) in [exec $fname arguments]

how can i do that ?

1

There are 1 best solutions below

0
On BEST ANSWER

You're looking for argument expansion:

set msg [exec $fname {*}$argmnts]

which treats the elements of the list in $argmnts as individual arguments to exec.