validate_integer

one of the documented procedures in this installation of the ACS
Usage:
validate_integer   field_name   string
What it does:
Throws an error if the string isn't a decimal integer; otherwise strips any leading zeros (so this won't work for octals) and returns the result.
Defined in: /web/philip/packages/acs-core/utilities-procs.tcl

Source code:


    if { ![regexp {^[0-9]+$} $string] } {
	error "The entry for $field_name, \"$string\" is not an integer"
    }
    # trim leading zeros, so as not to confuse Tcl
    set string [string trimleft $string "0"]
    if { [empty_string_p $string] } {
	# but not all of the zeros
	return "0"
    }
    return $string


philg@mit.edu