Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
26
Task/Exceptions/Tcl/exceptions-2.tcl
Normal file
26
Task/Exceptions/Tcl/exceptions-2.tcl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
set f "non-existent-file.txt"
|
||||
|
||||
try {
|
||||
puts "try begin"
|
||||
|
||||
set fd [open $f "r" ]
|
||||
|
||||
set contents [read $fd]
|
||||
|
||||
puts "try end"
|
||||
|
||||
} on error { results options } {
|
||||
puts stderr "results: $results"
|
||||
|
||||
foreach {opt val} $options {
|
||||
puts stderr "options:\t$opt $val"
|
||||
|
||||
}
|
||||
}
|
||||
puts "after try block"
|
||||
|
||||
if {[info exists contents] } {
|
||||
puts "$contents"
|
||||
} else {
|
||||
puts stderr "no contents read"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue