home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
pc
/
exsource
/
13_9.tcl
< prev
next >
Wrap
Text File
|
2003-04-16
|
285b
|
17 lines
#
# Example 13-9
# Creating array elements with array traces.
#
# make sure variable is an array
set dynamic() {}
trace variable dynamic r FixupDynamic
proc FixupDynamic {name index op} {
upvar 1 $name dynArray
if {![info exists dynArray($index)]} {
set dynArray($index) 0
}
}