User loginNavigation |
Why do we need finally in try?Why do we need the finally clause in exception handling pattern? I never understood why would one need it... or, rather, I was always able to code everything without using the finally block.
function f (file_handle h) {
try {
// do something dangerous
h.read;
}
catch (e) {
//catch the exception and do something
print_err ("Can't read file " + h.name);
}
h.close;
}
Why and in what situations does one need the finally clause? I hope that this question does not sound too stupid, as I believe that a lot of people are perfectly accomodated to using the By Tom Primožič at 2006-12-17 10:59 | LtU Forum | previous forum topic | next forum topic | other blogs | 18149 reads
|
Browse archives
Active forum topics |
Recent comments
3 weeks 6 days ago
4 weeks 14 hours ago
4 weeks 1 day ago
4 weeks 1 day ago
4 weeks 6 days ago
4 weeks 6 days ago
4 weeks 6 days ago
8 weeks 13 hours ago
8 weeks 5 days ago
8 weeks 6 days ago