end
. That way I can get the last element in a list with:
[lindex $mylist end]
What a relief! I was about to type:
[lindex $mylist [expr {[llength $mylist] - 1}]]
And if I had had to type that, my head would have exploded. Fortunately, I got away with just a pulsing vein on my temple at the thought of a pseudo-keyword like
end
.
2 comments:
Thanks, that was useful to me, poor tcl beginner.
This is the best one line blog I have ever seen. Thanks for posting the tip.
Post a Comment