tsv linsert
Puts elements into a list in a shared array.
tsv::linsert ARRAY ELEMENT INDEX VALUE ?VALUE ...?
Description
The command tsv::linsert puts each VALUE into the list in the element before the element at INDEX, as linsert does, and changes the list in place. end puts them after the last element.
Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
| ARRAY | array name | required | The name of the shared array. |
| ELEMENT | string | required | The name of the element. |
| INDEX | index | required | The place of the new elements. |
| VALUE | string | required | An element to put in. |
Returns
An empty string.
Examples
% tsv::set l x {a b}
> tsv::linsert l x 1 Q
> tsv::get l x
a Q b
% tsv::set l x {a b}
> tsv::linsert l x end R S
> tsv::get l x
a b R S
Errors
% tsv::set l x {a b}
> tsv::linsert l x 1
wrong # args: should be "tsv::linsert l x index element ?element ...?"
-errorcode TCL WRONGARGS
Facts
- Capability
thread. A new interpreter does not have it until the host turns it on.- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztcl 1.0.0-beta.1