home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Practical Programming in Tcl & Tk (4th Edition)
/
TCLBOOK4.BIN
/
mac
/
exsource.old
/
1_12.tcl
< prev
next >
Wrap
Text File
|
2003-04-15
|
225b
|
14 lines
#
# Example 1-12
# Defining a procedure.
#
proc Diag {a b} {
set c [expr {sqrt($a * $a + $b * $b)}]
return $c
}
puts "The diagonal of a 3, 4 right triangle is [Diag 3 4]"
#=> The diagonal of a 3, 4 right triangle is 5.0