Posted to tcl by kbk at Wed Jun 17 16:29:11 GMT 2009view raw
- proc isInRange {number ranges} {
- foreach r [split $ranges ,] {
- set bounds [split $r -]
- if {[llength $bounds] == 1} {lappend bounds [lindex $bounds 0]}
- if {$number >= [lindex $bounds 0] && $number <= [lindex $bounds 1]} {
- return 1
- }
- }
- return 0
- }