Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / share / tcl / help / tcl / lists / lappend
1 NAME
2 lappend - Append list elements onto a variable
3
4 SYNOPSIS
5 lappend varName ?value value value ...?
6
7
8 DESCRIPTION
9 This command treats the variable given by varName as a list and appends
10 each of the value arguments to that list as a separate element, with
11 spaces between elements. If varName doesn't exist, it is created as a
12 list with elements given by the value arguments. Lappend is similar to
13 append except that the values are appended as list elements rather than
14 raw text. This command provides a relatively efficient way to build up
15 large lists. For example, ``lappend a $b'' is much more efficient than
16 ``set a [concat $a [list $b]]'' when $a is long.
17
18 EXAMPLE
19 Using lappend to build up a list of numbers.
20 % set var 1
21 1
22 % lappend var 2
23 1 2
24 % lappend var 3 4 5
25 1 2 3 4 5
26
27
28 SEE ALSO
29 list(n), lindex(n), linsert(n), llength(n), lset(n) lsort(n), lrange(n)
30
31
32 KEYWORDS