开发者

how to push multiple values into an array in TCL

I am trying to append the values to an array as below and it is not appending to the value list

while {[gets $fp line] != -1} {

    if { [regexp {Path Group: (\w+)} $line all group]} {
        set hash($group) {}
 
    } elseif {[regexp {开发者_开发知识库\(VIOLATED\)\s+(-[0-9]*.[0-9]*)} $line all slack]} {
        puts "slack $slack\n"
         lappend hash($group) $slack     
    }

 }

parray hash

The output of the array hash is only the last value of the iteration bit not a list

expecting

Name { X Y Z} Age {3 4 5:}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜