Forum OpenACS Q&A: Response to Tcl question

3: Response to Tcl question (response to 1)
Posted by Michael A. Cleverly on
You want to do this:
set test1 25
set number 1
set test test$number
set t [set $test]
Now t will have the value of 25. It's easy to see what Tcl is doing if you drop to a shell and fire up tclsh:
% set test1 25
% set number 1
% set test test$number
% set t [set $test]
[set] when it receives only one argument treats that argument as the name of a variable and returns the value of the variable (if it exists--or throws an error if it doesn't exist). See