PHP 8.5.2
Preview: parray.tcl Size: 816 B
/usr/share/tcltk/tcl8.6/parray.tcl

# parray:
# Print the contents of a global array on stdout.
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

proc parray {a {pattern *}} {
    upvar 1 $a array
    if {![array exists array]} {
	return -code error "\"$a\" isn't an array"
    }
    set maxl 0
    set names [lsort [array names array $pattern]]
    foreach name $names {
	if {[string length $name] > $maxl} {
	    set maxl [string length $name]
	}
    }
    set maxl [expr {$maxl + [string length $a] + 2}]
    foreach name $names {
	set nameString [format %s(%s) $a $name]
	puts stdout [format "%-*s = %s" $maxl $nameString $array($name)]
    }
}

Directory Contents

Dirs: 5 × Files: 11

Name Size Perms Modified Actions
encoding DIR
- drwxr-xr-x 2026-01-08 12:55:44
Edit Download
http1.0 DIR
- drwxr-xr-x 2026-01-08 12:55:44
Edit Download
msgs DIR
- drwxr-xr-x 2026-01-08 12:55:44
Edit Download
opt0.4 DIR
- drwxr-xr-x 2026-01-08 12:55:44
Edit Download
tcl8 DIR
- drwxr-xr-x 2026-01-08 12:55:44
Edit Download
20.36 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
125.43 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
7.72 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
24.24 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
22.70 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
816 B lrw-r--r-- 2024-03-31 08:26:43
Edit Download
39.98 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
4.76 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
5.48 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
11.65 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download
4.78 KB lrw-r--r-- 2024-03-31 08:26:43
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).