you can increase the value of a var with: "incr codes_flood 1"
why can't you decrease it in a "called" proc?
<stenone> [07:47] Tcl error in script for 'timer400':
<stenone> [07:47] expected integer but got "codes_flood"
Code: Select all
proc stuff {usual stuff} {
global stuff
if flood stuff
if {$codes_found >= $codes_max} {
incr codes_flood 1
utimer 7 [list flood:dec codes_flood]
}
proc flood:dec {var} {
global codes_flood
incr var -1
if {$var < "0"} {set var "0"}
return 0
}