1

I am trying to find out number of elements failed and the results are to be printed in a .csv file. this is my code,

set n_min_len 10
set n_max_len 50
set n_angle 60
foreach check {"min length" "max length" "angle"} \
        fail {$n_min_len $n_max_len $n_angle} {
   puts $file [format %30s%10s "$check...." "$fail"]
   }

I get output as min length....$n_min_len max length....$n_max_len and so on. Instead I wanted output as min length....10 max length....50

can someone help me, how to get this.

thank you!!

1 Answer 1

2

The problem is with this part:

{$n_min_len $n_max_len $n_angle}

The braces block any substitution. Instead you should write

"$n_min_len $n_max_len $n_angle"

or

[list $n_min_len $n_max_len $n_angle]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.