Trying to set up list to format using format specifiers. Looking to have it be dynamic in building the specifiers and the value list to format.
set listLen 3 – works
set fmt “%-40.40s %-7.7s [lrepeat $listLen \%\-10\.10s]” – works
puts [format $fmt “A” “B” “C” “D” “E”] – works
Since the number of specifiers is 5, is there a way to use a variable for the values like
set valList {“A” “B” “C” “D” “E”} – works
puts [format $fmt $valList] – Doesn’t work
Error: not enough arguments for all format specifiers
I must be overlooking the obvious. Any ideas or help is appreciated….