upvar

upvar ?level? otherVar localVar ?otherVar localVar ...?

Links a local name to a variable of a caller. The level is 1 for the caller (the default), 2 for its caller, or #0 for the top level. This is the way to pass a variable by name.

Examples

A click on an example runs it in the shell of the page.

Facts