rick
2007-06-11 07:35:44 UTC
I am defining a variable inside a proc. And I want to use this
variable in another proc.
One way is to return that variable form that proc to the main script
and then access it in another proc by using global command. But is
there any way , I can access it in another proc directly.
eg :
proc1 {
set a xxx
}
proc2 {
puts $a
}
main script :
proc1
proc2
In the above example I want a defined in proc 1 to be accessible in
proc 2.
variable in another proc.
One way is to return that variable form that proc to the main script
and then access it in another proc by using global command. But is
there any way , I can access it in another proc directly.
eg :
proc1 {
set a xxx
}
proc2 {
puts $a
}
main script :
proc1
proc2
In the above example I want a defined in proc 1 to be accessible in
proc 2.