Site hosted by Angelfire.com: Build your free website today!
NAME
  lindex - Retrieve an element from a list

SYNOPSIS
  lindex list index

DESCRIPTION
  This command treats list as a Tcl list and returns the index'th element
  from it (0 refers to the first element of the list). In extracting the
  element, lindex observes the same rules concerning braces and quotes and
  backslashes as the Tcl command interpreter; however, variable
  substitution and command substitution do not occur. If index is negative
  or greater than or equal to the number of elements in value, then an
  empty string is returned. If index has the value end, it refers to the
  last element in the list.

EXAMPLE
  % lindex {ABC DEF GHI JKL} 2
  GHI

  % set x {ABC DEF GHI JKL}
  ABC DEF GHI JKL

  % lindex {ABC DEF {GHI JKL} MNO PQR} 2
  GHI JKL

SEE ALSO
  lappend linsert list llength lrange lreplace lsearch lsort