Vivado% proc myproc {arg} { puts $arg } Vivado% myproc myname myname Vivado% if {2>1} { puts 2>1 } else { puts 2<1 } 2>1 Vivado% set grade c c Vivado% switch $grade A {puts "well done"} B {puts "excellent"} C {puts "good"} Vivado% switch $grade {A {puts "well done"} B {puts "excellent"} C {puts "good"} } Vivado% switch 2 { 1 {puts 111} 2 {puts 222} 3 {puts 333} default {puts xxx} } 222
爲何spa
Vivado% switch $grade A {puts "well done"} B {puts "excellent"} C {puts "good"} Vivado% switch $grade {A {puts "well done"} B {puts "excellent"} C {puts "good"} }
原來是set grade c這一句代碼中的c要大寫纔能有顯示excel