From da4f00b003469298b4cdf2bd2f0ab8646e2ec8ba Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 15 Jul 2003 22:21:26 +0000 Subject: D'oh! Forgot one of the examples... --- doc/array.n | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/array.n b/doc/array.n index 37d3fb9..969d013 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.10 2003/07/15 22:17:06 dkf Exp $ +'\" RCS: @(#) $Id: array.n,v 1.11 2003/07/15 22:21:26 dkf Exp $ '\" .so man.macros .TH array n 8.3 Tcl "Tcl Built-In Commands" @@ -164,6 +164,14 @@ foreach color [array names colorcount] { Color: green Count: 5 Color: red Count: 1 +foreach color [lsort [array names colorcount]] { + puts "Color: $color Count: $colorcount($color)" +} + => Color: blue Count: 4 + Color: green Count: 5 + Color: red Count: 1 + Color: white Count: 9 + array statistics colorcount => 4 entries in table, 4 buckets number of buckets with 0 entries: 1 -- cgit v0.12