home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
mac
/
exsource.old
/
7_6.tcl
< prev
next >
Wrap
Text File
|
2003-04-15
|
208b
|
17 lines
#
# Example 7-6
# Improved incr procedure.
#
proc incr { varName {amount 1}} {
upvar 1 $varName var
if {[info exists var]} {
set var [expr $var + $amount]
} else {
set var $amount
}
return $var
}