Copyright (c) 1993 The Regents of the University of California.
Copyright (c) 1994-1996 Sun Microsystems, Inc.
Copyright (c) 2001 Kevin B. Kenny. All rights reserved.

See the file "license.terms" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.

RCS: @(#) $Id: llength.n,v 1.6.4.1 2004/10/27 12:52:40 dkf Exp $

.so man.macros
llength n "" Tcl "Tcl Built-In Commands"
S Note: do not modify the .SH NAME line immediately below!
NAME
llength - Count the number of elements in a list
SYNOPSIS
llength list E
DESCRIPTION

Treats list as a list and returns a decimal string giving the number of elements in it.

EXAMPLES
The result is the number of elements: .CS % llength {a b c d e} 5 % llength {a b c} 3 % llength {} 0 .CE

Elements are not guaranteed to be exactly words in a dictionary sense of course, especially when quoting is used: .CS % llength {a b {c d} e} 4 % llength {a b { } c d e} 6 .CE

An empty list is not necessarily an empty string: .CS % set var { }; puts "[string length $var],[llength $var]" 1,0 .CE

"SEE ALSO"
.VS 8.4 list(n), lappend(n), lindex(n), linsert(n), lsearch(n), lset(n), lsort(n), lrange(n), lreplace(n) .VE
KEYWORDS
element, list, length