Posted to tcl by Maximus at Mon Sep 30 10:55:05 GMT 2019view raw
- set num "0"
- proc myNum {} {
- global num
- for {set i 0} {$i < 10} {incr i} {
- if {[info exists num]} {
- set num [expr 1 + $num]
- } else {
- set num 1
- }
- }
- puts $num
- }
- myNum
- puts "Found: $num"