RosettaCodeData/Task/Flow-control-structures/Tcl/flow-control-structures-5.tcl

11 lines
186 B
Tcl

try {
# Just a silly example...
set f [open $filename]
expr 1/0
string length [read $f]
} trap {ARITH DIVZERO} {} {
puts "divided by zero"
} finally {
close $f
}