Reputation: 53
Can I access a variable in Tcl without using $
(dollar) sign?
Can I assign one variable value to new variable without using dollar sign?
Example:
set x 10
I need to access value of x
without dollar sign.
Upvotes: 2
Views: 377
Reputation: 13252
Well, yes. The $x
notation is actually shorthand for the invocation set x
, so you can do this:
set x 10 ;# assign to variable
puts [set x] ;# access the value
set y [set x] ;# assign value to other variable
Upvotes: 4