I am not catching some of the nuances of passing variables
between stacklevels here..if someone could explain what I
am doing wrong I would appreciate it;-)
If I have code that looks like this:
#script main
set R 12
proc echo_val {N} {
upvar #0 $N loc
puts "Local value of proc arg $N is $loc"
}
echo_val $R
#end
"Error is can't read loc, no such variable."
Which seems pretty bizarre to me since from what
I understand upvar aliases point to a value up the stack.
I have also read that the statement upvar #0 is
equivalent to the global declaration.
I have used upvar with the tcl_http package with no
problem so this simple translation of variable aliases
is baffling me.
Does the upvar alias have to exist in the same scope
as the original var?
between stacklevels here..if someone could explain what I
am doing wrong I would appreciate it;-)
If I have code that looks like this:
#script main
set R 12
proc echo_val {N} {
upvar #0 $N loc
puts "Local value of proc arg $N is $loc"
}
echo_val $R
#end
"Error is can't read loc, no such variable."
Which seems pretty bizarre to me since from what
I understand upvar aliases point to a value up the stack.
I have also read that the statement upvar #0 is
equivalent to the global declaration.
I have used upvar with the tcl_http package with no
problem so this simple translation of variable aliases
is baffling me.
Does the upvar alias have to exist in the same scope
as the original var?