列印變數的值

為了列印變數的值,如:

set tempVar "This is a string."

puts 語句中的引數前面有一個 $ 符號,它告訴 Tcl 使用變數的值。

% set tempVar "This is a string."
This is a string.
% puts $tempVar
This is a string.