projman/hlp/en/tcl/lrange.htm
2015-10-19 14:27:31 +04:00

32 lines
1.9 KiB
HTML

<HTML><HEAD><TITLE>Tcl Built-In Commands - lrange manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
lrange - Return one or more adjacent elements from a list
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>lrange </B><I>list first last</I><BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
<I>List</I> must be a valid Tcl list. This command will
return a new list consisting of elements
<I>first</I> through <I>last</I>, inclusive.
<I>First</I> or <I>last</I>
may be <B>end</B> (or any abbreviation of it) to refer to the last
element of the list.
If <I>first</I> is less than zero, it is treated as if it were zero.
If <I>last</I> is greater than or equal to the number of elements
in the list, then it is treated as if it were <B>end</B>.
If <I>first</I> is greater than <I>last</I> then an empty string
is returned.
Note: ``<B>lrange </B><I>list first first</I>'' does not always produce the
same result as ``<B>lindex </B><I>list first</I>'' (although it often does
for simple fields that aren't enclosed in braces); it does, however,
produce exactly the same results as ``<B>list [lindex </B><I>list first</I><B>]</B>''
<H3><A NAME="M5">SEE ALSO</A></H3>
<B><A HREF="../TkCmd/lappend.htm">lappend</A></B>, <B><A HREF="../TkCmd/lindex.htm">lindex</A></B>, <B><A HREF="../TkCmd/linsert.htm">linsert</A></B>, <B><A HREF="../TkCmd/list.htm">list</A></B>, <B><A HREF="../TkCmd/llength.htm">llength</A></B>, <B><A HREF="../TkCmd/lreplace.htm">lreplace</A></B>
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/E.htm#element">element</A>, <A href="../Keywords/L.htm#list">list</A>, <A href="../Keywords/R.htm#range">range</A>, <A href="../Keywords/S.htm#sublist">sublist</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1993 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>