Code: Select all
proc repeatCheck {iphost} {
 # Access and Store GLOBAL
 global repeat repeat_count
 # Check for existence, add if it didn't exist
 if {![info exists repeat_count($iphost)] && [lsearch -exact $repeat 0] == -1} {
  set repeat_count($iphost) 0
 }
 # Increase count and set timer to remove it
 incr repeat_count($iphost) 1
 utimer [lindex $repeat 1] [list unset -nocomplain repeat_count($iphost)]
 # Do what when reach the maximum repeat
 if {$repeat_count($iphost) == [lindex $repeat 0]} {
  return 1
 }
 return 0
}
Code: Select all
proc repeatCheck {iphost} {
 # Access and Store GLOBAL
 global repeat repeat_count
 # Check for existence, add if it didn't exist
 if {![info exists repeat_count($iphost)]} {
  lappend repeat_count($iphost) 0
 }
 # Increase count and set timer to remove it
 incr repeat_count($iphost)
 foreach utimer [utimers] {
  if {[string match "unset repeat_count($iphost)" [lindex $utimer 1] ]} {
   set timerCheck 1
  }
 }
 if {![info exists timerCheck]} {
  utimer [lindex $repeat 1] "unset repeat_count($iphost)"
 } else {
  unset timerCheck
 }
 # Do what when reach the maximum repeat
 if {$repeat_count($iphost) > [lindex $repeat 0]} {
  return 1
 }
 return 0
}
Code: Select all
set myvar "Testing "in string"Code: Select all
set myvar "Testing \"in string"
set myvar {Testing "in string}Code: Select all
#Make {Testing "in string} a single list-element:
set myvar [list "Testing \"in string"]
set myvar [list {Testing "in string}]
#Make Testing "in string separate list elements:
set myvar [list Testing \"in string]
set myvar [list Testing {"in} string]