VarName | Name of variable to check for and upvar (same as first argument to upvar). |
Var | Name of variable after upvar (same as second argument to upvar). |
The following code creates a proc that relies on variable existing. When it does not exist, UpvarExistingOrDie will create an error.
proc MyPrintVar {VarName} {
UpvarExistingOrDie $VarName Var
puts "$VarName = $Var"
}
% set abc 123
% MyPrintVar abc
abc = 123
% unset abc
% MyPrintVar abc
Could not find variable abc.