Version 0 of lappend

Updated 2001-05-29 23:15:10

lappend varName ?value value ...?

Appends each value to the end of the list stored in varName. (From the Tcl/Tk Reference Guide)

lappend is the only list-command which requires the name of the list rather than the list itself.

 lappend listName

rather than

 lappend $listName

This command differs from append in that values are appended as list elements rather than raw text.

lappend will not make varName a list ; if it is one before the command, it will continue to be one.

You do not need to assign the results of lappend to varName; lappend modifies varName directly.


Tcl syntax help - Arts and crafts of Tcl-tk programming