Visible to Intel only — GUID: mwh1410471029398
Ixiasoft
Visible to Intel only — GUID: mwh1410471029398
Ixiasoft
2.13.5. Lists
set a { 1 2 3 }
You can use the lindex command to extract information at a specific index in a list. Indexes are zero-based. You can use the index end to specify the last element in the list, or the index end-< n> to count from the end of the list. For example, to print the second element (at index 1) in the list stored in a use the following code.
puts [lindex $a 1]
The llength command returns the length of a list.
puts [llength $a]
The lappend command appends elements to a list. If a list does not already exist, the list you specify is created. The list variable name is not specified with a dollar sign (“$”).
lappend a 4 5 6