]>
git.zerfleddert.de Git - micropolis/blob - res/parray.tcl
2 # Print the contents of a global array on stdout.
4 # $Header: /sprite/src/lib/tcl/scripts/RCS/parray.tcl,v 1.1 91/09/26 09:55:03 ouster Exp $ SPRITE (Berkeley)
6 # Copyright 1991 Regents of the University of California
7 # Permission to use, copy, modify, and distribute this
8 # software and its documentation for any purpose and without
9 # fee is hereby granted, provided that this copyright
10 # notice appears in all copies. The University of California
11 # makes no representations about the suitability of this
12 # software for any purpose. It is provided "as is" without
13 # express or implied warranty.
19 foreach name
[lsort [array names
$a]] {
20 if {[string length
$name] > $maxl} {
21 set maxl
[string length
$name]
24 set maxl
[expr {$maxl + [string length
$a] + 2}]
25 foreach name
[lsort [array names
$a]] {
26 set nameString
[format %s
(%s
) $a $name]
27 puts stdout
[format "%-*s = %s" $maxl $nameString [set ${a
}($name)]]