# procs i want to be global, all others in my own namespace procs command_newcommand otherproc # add a new variable, if it doesnt exist (from saved prefs) set it to default AddToPrefs mynewvar string "default" proc command_newcommand {window line} { Echo $window "you typed $line" } proc mylocalproc { } { # this proc wasnt declared in "procs" line so its in a local namespace } proc otherproc { } { # this is global } proc unload { } { # this local proc marks the script as unloadable # if theres any additional cleanup to be done # it goes here (destroy widgets, etc) RemoveFromPrefs mynewvar }