How to check if list element exists in TCL?

Say I have a TCL list, and I have append some elements to my list. Now I want to check if I have appended 6 or 7 elements.

In order to check if list element exists in the place specified by an index I have used:

if { [info exists [lindex $myList 6]] } {
#if I am here then I have appended 7 elems, otherwise it should be at least 6
}

But seams this does not work. How I should do that? properly? It is OK to check if { [lindex $myList 6]] eq "" }

8
задан Narek 11 April 2011 в 07:06
поделиться