Version 3 of llength

Updated 2004-08-20 13:14:55

The man page for llength is http://purl.org/tcl/home/man/tcl8.4/TclCmd/llength.htm

This command returns the number of elements in the list. If the string is not a well-formed list, an error will be thrown.


caspian: Make sure to give llength the list, not just the name variable where the list is stored.

Correct:

 set mylist [list "a" "b" "c"]
 llength $mylist

Incorrect:

  set mylist [list "a" "b" "c"]
 llength mylist

See also list, lappend, lindex, linsert, lrange, lreplace, lsearch, lsort .


Tcl syntax help - Arts and crafts of Tcl-Tk programming - Category Command