home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
pc
/
exsource.old
/
7_3.tcl
< prev
next >
Wrap
Text File
|
2003-04-15
|
188b
|
22 lines
#
# Example 7-3
# Variable scope and Tcl procedures.
#
set a 5
set b -8
proc P1 {a} {
set b 42
if {$a < 0} {
return $b
} else {
return $a
}
}
P1 $b
#=> 42
P1 [expr $a*2]
#=> 10