projman/hlp/en/tcl/lappend.htm

28 lines
1.7 KiB
HTML
Raw Normal View History

2015-10-19 13:27:31 +03:00
<HTML><HEAD><TITLE>Built-In Commands - lappend manual page</TITLE></HEAD><BODY>
<H3><A NAME="M2">NAME</A></H3>
lappend - Append list elements onto a variable
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>lappend </B><I>varName </I>?<I>value value value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This command treats the variable given by <I>varName</I> as a list
and appends each of the <I>value</I> arguments to that list as a separate
element, with spaces between elements.
If <I>varName</I> doesn't exist, it is created as a list with elements
given by the <I>value</I> arguments.
<B>Lappend</B> is similar to <B><A HREF="../TkCmd/append.htm">append</A></B> except that the <I>value</I>s
are appended as list elements rather than raw text.
This command provides a relatively efficient way to build up
large lists. For example, ``<B>lappend a $b</B>'' is much
more efficient than ``<B>set a [concat $a [list $b]]</B>'' when
<B>$a</B> is long.
<H3><A NAME="M5">SEE ALSO</A></H3>
<B><A HREF="../TkCmd/list.htm">list</A></B>, <B><A HREF="../TkCmd/lindex.htm">lindex</A></B>, <B><A HREF="../TkCmd/linsert.htm">linsert</A></B>, <B><A HREF="../TkCmd/llength.htm">llength</A></B>, <B><A HREF="../TkCmd/lsort.htm">lsort</A></B>, <B><A HREF="../TkCmd/lrange.htm">lrange</A></B>
<H3><A NAME="M6">KEYWORDS</A></H3>
<A href="../Keywords/A.htm#append">append</A>, <A href="../Keywords/E.htm#element">element</A>, <A href="../Keywords/L.htm#list">list</A>, <A href="../Keywords/V.htm#variable">variable</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>