lrange(n) Tcl Built-In Commands lrange(n) _________________________________________________________________ NAME lrange - Return one or more adjacent elements from a list SYNOPSIS lrange _l_i_s_t _f_i_r_s_t _l_a_s_t _________________________________________________________________ DESCRIPTION _L_i_s_t must be a valid Tcl list. This command will return a new list consisting of elements _f_i_r_s_t through _l_a_s_t, inclusive. _F_i_r_s_t or _l_a_s_t may be end (or any abbreviation of it) to refer to the last element of the list. If _f_i_r_s_t is less than zero, it is treated as if it were zero. If _l_a_s_t is greater than or equal to the number of elements in the list, then it is treated as if it were end. If _f_i_r_s_t is greater than _l_a_s_t then an empty string is returned. Note: ``lrange _l_i_s_t _f_i_r_s_t _f_i_r_s_t'' does not always produce the same result as ``lindex _l_i_s_t _f_i_r_s_t'' (although it often does for simple fields that aren't enclosed in braces); it does, how- ever, produce exactly the same results as ``list [lindex _l_i_s_t _f_i_r_s_t]'' KEYWORDS element, list, range, sublist Tcl Last change: 7.4 1