Tcl Variables
Tcl variables are always strings even when they contain numeric values. For most applications, using strings has no effect, but occasionally a HyperWorks application will expect a real number and passing a string will cause an error.
Tcl variables may not contain tabs, spaces, carriage returns, nor the following characters: $ [ ] { } . #
set var1 "one plus one equals";
set var2 "2";
set var1 "one plus one equals 2";
set var1;
one plus one equals 2
set var2 "var1";
set var2;
var1
set [set var2];
one plus one equals 2
puts "The expression: $var1 $var2";
The expression: one plus one equals 2
set var2 "2";
set var2 {};
puts $var2;
Tcl returns a carriage return.
set var2 "2";
unset var2;
puts $var2;
can't read "var2": no such variable