1append(n) Tcl Built-In Commands append(n)
2
3
4
5______________________________________________________________________________
6
8 append - Append to variable
9
11 append varName ?value value value ...?
12______________________________________________________________________________
13
15 Append all of the value arguments to the current value of variable var‐
16 Name. If varName does not exist, it is given a value equal to the con‐
17 catenation of all the value arguments. The result of this command is
18 the new value stored in variable varName. This command provides an
19 efficient way to build up long variables incrementally. For example,
20 “append a $b” is much more efficient than “set a $a$b” if $a is long.
21
23 Building a string of comma-separated numbers piecemeal using a loop.
24
25 set var 0
26 for {set i 1} {$i<=10} {incr i} {
27 append var "," $i
28 }
29 puts $var
30 # Prints 0,1,2,3,4,5,6,7,8,9,10
31
33 concat(n), lappend(n)
34
36 append, variable
37
38
39
40Tcl append(n)