Since I don't like global variables (unless you have a small script), I combine the solutions from @kostix and @Jackson:
namespace eval foo { variable varList {} } proc foo::useCount {value} { variable varList lappend varList $value } foo::useCount One foo::useCount Two puts $foo::varList
Roalt source share