ad_integer_optionlist

one of the documented procedures in this installation of the ACS
Usage:
ad_integer_optionlist   start_value   end_value   { default "" }   { pad_to_two_p "0" }
What it does:
Produces an optionlist for a range of integers from start_value to end_value. If default matches one of the options, it is selection. If pad_to_two_p is 1, the option values will be padded to 2 digites with a leading 0.
Defined in: /web/philip/packages/acs-core/widgets-procs.tcl

Source code:


    # items is a list of the items you would like the user to select from
    # values is a list of corresponding option values
    # default is the value of the item to be selected
    set count 0
    set return_string ""
    
    
    for { set x $start_value } { $x <= $end_value } { incr x } {

	if { $pad_to_two_p && $x >= 0 && $x < 10 } {
	    set value "0$x"
	} else {
	    set value $x
	}

	if { $default == $value } {
	    append return_string "<option SELECTED value=\"$value\">$value\n"
	} else {
	    append return_string "<option value=\"$value\">$value\n"
	}
    }
    return $return_string


philg@mit.edu