Qualifying a global variable is done by prefixing the variable name with the :: character sequence. This is a special case of namespace qualification where the :: prefix indicates that the variable resides in the global namespace.

Example:

set globalvar 100.2
proc test1 {} {
    puts "test1: $::globalvar"
}
proc test2 {} {
    puts "test2: $::globalvar"
}
test1
test2

Result:

test1: 100.2
test2: 100.2

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading