append
Append values to a variable.
Syntax
tcl
append varName ?value ...?Parameters
- varName: Name of the variable to append to
- value: One or more values to concatenate
Description
Concatenates all value arguments to the end of the variable varName. If the variable doesn't exist, it is created as an empty string before appending. Returns the new value.
Examples
Building a string
Output
Creating variable via append
Output
Building output in a loop
Output
See Also
- set - Get or set variable value
- concat - Concatenate lists
- string cat - Concatenate strings
