I have a test.tcl file that sources another common.tcl file which contains common procs. Here's a sample content of the common.tcl :
set top_path path.to.top
set path_a $top_path.a
proc x { level } {
if { $level == "top" } {
puts $top_path
}
if { $level == "a" } {
puts $path_a
}
}
proc y {
puts $env(WORKAREA)
}
And here's how the test.tcl looks like :
source $env(PATH_TO_COMMON)/common.tcl
x top
y
The error I'm getting is that the variables (the ones set at the topmost 2 lines of common.tcl) and even the environment variable WORKAREA could not be read (no such variable). No matter if I use set ::env(top_path) and try to read it inside the proc as puts $::env(top_path), I see the same error. Any simple way to resolve this ? There are many lines of setting variables that I need to update.
globalandvariablecommands.