projman/hlp/en/tcl/lreplace.htm

40 lines
2.4 KiB
HTML
Raw Normal View History

2015-10-19 13:27:31 +03:00
<HTML><HEAD><TITLE>Tcl Built-In Commands - lreplace manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
lreplace - Replace elements in a list with new elements
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>lreplace </B><I>list first last </I>?<I>element element ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
<B>lreplace</B> returns a new list formed by replacing one or more elements of
<I>list</I> with the <I>element</I> arguments.
<I>first</I> and <I>last</I> specify the first and last index of the
range of elements to replace. 0 refers to the first element of the
list, and <B>end</B> (or any abbreviation of it) may be used to refer
to the last element of the list. If <I>list</I> is empty, then
<I>first</I> and <I>last</I> are ignored.
If <I>first</I> is less than zero, it is considered to refer to the
first element of the list. For non-empty lists, the element indicated
by <I>first</I> must exist.
If <I>last</I> is less than zero but greater than <I>first</I>, then any
specified elements will be prepended to the list. If <I>last</I> is
less than <I>first</I> then no elements are deleted; the new elements
are simply inserted before <I>first</I>.
The <I>element</I> arguments specify zero or more new arguments to
be added to the list in place of those that were deleted.
Each <I>element</I> argument will become a separate element of
the list. If no <I>element</I> arguments are specified, then the elements
between <I>first</I> and <I>last</I> are simply deleted. If <I>list</I>
is empty, any <I>element</I> arguments are added to the end of the list.
<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/lrange.htm">lrange</A></B>, <B><A HREF="../TkCmd/lsearch.htm">lsearch</A></B>, <B><A HREF="../TkCmd/lsort.htm">lsort</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#replace">replace</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>