proc ?append {v_name args} {
upvar $v_name v
if {![info exists v]} {
return -code error "expected $v_name to exist!"
}
if {[array exists v]} {
return -code error "can't set \"$v_name\": variable is array"
}
foreach val $args {
append v $val
}
return $v
} ;# GPSDKF: I've updated the code above to match the calling convention for appendMC: I've updated the code to return the value of $val and to give the same error message if you try to append to the name of an array, like append does :-)See also ?set, ?lappend
