In TCL (running v8.6.6) I want to create an array with a substitution of one or more of the value of the array with the value of another variable.
If we were in C I will write
float a = 10;
float b[4] = {1.0, 2.0, 3.0, 4.0};
b[2]=a;
and if I print on stdout I got 1.0 10.0 3.3 4.0.
In TCL instead I started by a simple exampe. I wrote
set a 10.0
set b $a
puts $b
I got 10.0 as output, but if I want to do the same in a array so I wrote
set a 10.0
set b {1.0 $a 3.0 4.0}
puts $b
and I'm expecting
1.0 10.0 3.0 4.0
but I got
-0.5 $a 0.5 0.79
Any idea?
Thanks a lot
1.0 2.0 10.0 4.01.0 $a 3.0 4.0. What you say your C code prints is different from what should be seen too, though, so there's got to be more going on that you didn't share in the question.