The switch command matches its string argument against each of the pattern arguments in order.
Example:
set thickness t2
switch $thickness {
t1 { puts 0.01 }
t2 { puts 0.02 }
t3 { puts 0.03 }
t4 { puts 0.04 }
default { puts "unknown" }
}
Result:
0.02
Last Updated on 2022-01-05 by gantovnik
Recent Comments