local/global variables and procedures

Philip Greenspun's Homepage : Philip Greenspun's Homepage Discussion Forums : 6916 : One Thread
Notify me of new responses
i am building the .tcl page for ex12. if i set a variable inside the
procedure, does it persists when i close the procedure, or is it just
local? if there is global variable, can i give it a value inside the
procedure that would persist when the procedure is closed?

-- Ines Sousa, September 22, 1999

Answers

Variable inside of procedures are locally scoped and do not persist outside of the procedure. See page 77 of the black TCL book for details. Check out the 'global' and 'upvar' commands to see how to alter scoping.

-- James Buszard-Welcher, September 22, 1999