Hello all!
I have such a script
[tt]
.......
set list {{a b} {a b (c)} {a b ([d])}}
puts stdout "$list"
foreach el $list {
puts stdout "<$el> --> [lsearch $list $el]"
}
puts stdout "[lsearch $list {a b ([d])}]"
.......
[/tt]
Why is searching of the last element of the list always [tt]-1[/tt]?
Thanks.
I have such a script
[tt]
.......
set list {{a b} {a b (c)} {a b ([d])}}
puts stdout "$list"
foreach el $list {
puts stdout "<$el> --> [lsearch $list $el]"
}
puts stdout "[lsearch $list {a b ([d])}]"
.......
[/tt]
Why is searching of the last element of the list always [tt]-1[/tt]?
Thanks.