summaryrefslogtreecommitdiffstats
path: root/doc/array.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
commit45beb64f7dcb09a6ce83532702bca760f72e6f4d (patch)
treef7746a2a8316d612570e1456524e3d182e855c82 /doc/array.n
parent5bc57d7b0f63d86fc383565d69f7704943fff94d (diff)
downloadtcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.zip
tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.gz
tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.bz2
Yet more doc update backporting
Diffstat (limited to 'doc/array.n')
-rw-r--r--doc/array.n15
1 files changed, 7 insertions, 8 deletions
diff --git a/doc/array.n b/doc/array.n
index c62e772..d0db722 100644
--- a/doc/array.n
+++ b/doc/array.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: array.n,v 1.8.18.2 2003/07/15 22:18:02 dkf Exp $
+'\" RCS: @(#) $Id: array.n,v 1.8.18.3 2004/10/27 14:23:41 dkf Exp $
'\"
.so man.macros
.TH array n 8.3 Tcl "Tcl Built-In Commands"
@@ -137,26 +137,25 @@ error will be raised. If \fIpattern\fR is omitted and \fIarrayName\fR is
an array variable, then the command unsets the entire array.
The command always returns an empty string.
.VE 8.3
-
.SH EXAMPLES
.CS
-array set colorcount {
+\fBarray set\fR colorcount {
red 1
green 5
blue 4
white 9
}
-foreach {color count} [array get colorcount] {
- puts "Color: $color Count: $count"
+foreach {color count} [\fBarray get\fR colorcount] {
+ puts "Color: $color Count: $count"
}
=> Color: blue Count: 4
Color: white Count: 9
Color: green Count: 5
Color: red Count: 1
-foreach color [array names colorcount] {
- puts "Color: $color Count: $colorcount($color)"
+foreach color [\fBarray names\fR colorcount] {
+ puts "Color: $color Count: $colorcount($color)"
}
=> Color: blue Count: 4
Color: white Count: 9
@@ -171,7 +170,7 @@ foreach color [lsort [array names colorcount]] {
Color: red Count: 1
Color: white Count: 9
-array statistics colorcount
+\fBarray statistics\fR colorcount
=> 4 entries in table, 4 buckets
number of buckets with 0 entries: 1
number of buckets with 1 entries: 2