我有以下问题:
set start "input[0]"
set end "output[0]"
set myArray($start,$end,pin) 1
set x "input[0]"
set y "output[0]"
set test [array names myArray $x,$y,pin]
puts "\n$test"
输出应该是:
input[0],output[0]
但输出是:
{}
如果我做:
set test [array names myArray *,*,pin]
puts "\n$test"
输出是:
input[0],output[0]
另外,如果我用原始代码替换[]
的{}
ie.input{0},output{0}
话。
有人可以告诉我这里发生了什么吗?如何逃脱[]
括号?