【发布时间】:2013-12-19 13:06:45
【问题描述】:
我有以下问题:
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}
原始代码有效。
谁能告诉我这里发生了什么?如何转义 [] 括号?
【问题讨论】:
标签: arrays tcl square-bracket