(Windows) 1 % incr i
1
(Windows) 2 % incr $i
1
(Windows) 3 % incr $$i
1
(Windows) 5 % puts $i
1
(Windows) 6 % puts $$i
$1
Shouldn't
incr $i or incr $$i
return an error from the Tcl interpreter as incr is looking for the var
name, not the variable?
Thanks!
>Shouldn't
> incr $i or incr $$i
>return an error from the Tcl interpreter as incr is looking for the var
>name, not the variable?
See the initial comment.
Hint: Repeat your experiments from above and then do an 'info vars' -
you will find variables named '1', '$1', etc.
HTH
Helmut Giese
> Shouldn't
> incr $i or incr $$i
> return an error from the Tcl interpreter as incr is looking for the var
> name, not the variable?
Take a look:
% set a 1
1
% set b a
a
% incr $b
2
% incr $b
3
% incr $b
4
% puts $b
a
% puts [set $b]
4
Now you know? ;)
--
ZB