Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/llength.n @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 1.3 KB
Line 
1'\"
2'\" Copyright (c) 1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>.  All rights reserved.
5'\"
6'\" See the file "license.terms" for information on usage and redistribution
7'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8'\"
9'\" RCS: @(#) $Id: llength.n,v 1.14 2008/03/26 09:59:22 dkf Exp $
10'\"
11.so man.macros
12.TH llength n "" Tcl "Tcl Built-In Commands"
13.BS
14'\" Note:  do not modify the .SH NAME line immediately below!
15.SH NAME
16llength \- Count the number of elements in a list
17.SH SYNOPSIS
18\fBllength \fIlist\fR
19.BE
20
21.SH DESCRIPTION
22.PP
23Treats \fIlist\fR as a list and returns a decimal string giving
24the number of elements in it.
25
26.SH EXAMPLES
27The result is the number of elements:
28.CS
29% \fBllength\fR {a b c d e}
305
31% \fBllength\fR {a b c}
323
33% \fBllength\fR {}
340
35.CE
36.PP
37Elements are not guaranteed to be exactly words in a dictionary sense
38of course, especially when quoting is used:
39.CS
40% \fBllength\fR {a b {c d} e}
414
42% \fBllength\fR {a b { } c d e}
436
44.CE
45.PP
46An empty list is not necessarily an empty string:
47.CS
48% set var { }; puts "[string length $var],[\fBllength\fR $var]"
491,0
50.CE
51
52.SH "SEE ALSO"
53list(n), lappend(n), lindex(n), linsert(n), lsearch(n),
54lset(n), lsort(n), lrange(n), lreplace(n)
55
56.SH KEYWORDS
57element, list, length
Note: See TracBrowser for help on using the repository browser.