TABLE OF CONTENTS


::pwtk::int_in_range1_

SYNOPSIS

proc ::pwtk::int_in_range1_ {index lastIndex} {

PURPOSE

Check that index is integer and is in [1,lastIndex] range.

SOURCE

    if { ! [string is integer -strict $index] } {
        uplevel 1 [list ::pwtk::error "expected integer for index, but got $index" 1]
    }
    if { $index < 1 || $index > $lastIndex } {
        uplevel 1 [list ::pwtk::error "index $index is out of range, must be within \[1,$lastIndex]" 1]
    }
    return $index
}