The global variable can be declared with the global keyword.
Example:
set globalvar 100.2
proc test1 {} {
global globalvar
puts "test1: $globalvar"
}
proc test2 {} {
global globalvar
puts "test2: $globalvar"
}
test1
test2
Result:
test1: 100.2 test2: 100.2
Last Updated on 2022-01-05 by gantovnik
Recent Comments