dict append
Adds text to the end of the value of a key in the dict of a variable.
dict append VAR KEY ?STRING ...?
Description
Adds each STRING to the end of the value of KEY in the dict of the variable VAR, with no separator, and gives the new dict. A missing key starts as an empty string, and a VAR with no value starts as an empty dict. With no STRING the key gets an empty value when it is missing.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| VAR | variable name | required | The variable with the dict. |
| KEY | string | required | The key of the text. |
| STRING | string | none | Text to add. |
Returns
The new value of VAR.
Examples
% set d {s ab}
> dict append d s c d
s abcd
% set d {}
> dict append d s x
s x
Errors
% dict append d
wrong # args: should be "dict append dictVarName key ?value ...?"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1