export_var var_name { default " " }What it does:
Returns a variable's value if it exists. This can be used to protect against undefined variables.Defined in: /web/philip/tcl/utils-extra.tcl
Source code:
# export_var protects against undefined variables # Returns the value of the variable if it exists in the caller's environment. # Otherwise, returns default. if [eval uplevel {info exists $var_name}] { upvar $var_name value return "$value" } else { return "$default" }