Tcl placing a value of a variable as the name a the variable

后端 未结 2 650
情书的邮戳
情书的邮戳 2021-01-23 00:04

I\'m having some issues with Tcl. I have a variable that has a string in it. Butt now I want this string to be the name of a next variable.

I have found some similar que

2条回答
  •  一个人的身影
    2021-01-23 00:33

    I'm thinking you want upvar to create an "alias" variable name

    $ tclsh
    % set name Test
    Test
    % upvar 0 cell $name
    % set cell 42
    42
    % puts $Test
    42
    

提交回复
热议问题