普通变量参数
proc SetVal {data} {
upvar $data d
set d 1
}
set data 0
SetVal data
puts "after SetVal"
puts "data = $data"
数组参数
proc SetVal {ptr} {
upvar ptr a
set a(0) "this is the 1st element"
set a(1) "this is the 2nd element"
}
SetVal ptr
puts "after SetVal"
puts $ptr(0)
puts $ptr(1)