Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2004.01.23;
Скачать: [xml.tar.bz2];

Вниз

try finally   Найти похожие ветки 

 
Sandman25   (2004-01-12 11:48) [0]

Доброе время суток.

Читаю Object Pascal Language Guide:
If an exception is raised but not handled in the finally clause, that exception is propagated out of the try...finally statement, and any exception already raised in the try clause is lost. The finally clause should therefore handle all locally raised exceptions, so as not to disturb propagation of other exceptions.

Значит ли это, что рекомендуют писать
try
...
finally
try
...
except
end;
end;
???
Но ведь сами же раньше пишут:
Exceptions provide an elegant way to trap runtime errors without halting the program and without awkward conditional statements. The complexity of Object Pascal’s exception-handling mechanism, however, makes it inefficient, and it should therefore be used judiciously. While it is possible to raise exceptions for almost any reason, and to protect almost any block of code by wrapping it in a try...except or try...finally statement, in practice these tools are best reserved for special situations.

Чему верить?


 
Anatoly Podgoretsky   (2004-01-12 11:55) [1]

Все правильно написано


 
Sandman25   (2004-01-12 12:01) [2]

[1] Anatoly Podgoretsky © (12.01.04 11:55)

То есть все-таки The finally clause should therefore handle all locally raised exceptions не нужно понимать буквально, а смотреть по ситуации? Понятно. Спасибо.



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2004.01.23;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.007 c
8-72839
nuflin
2003-09-21 19:21
2004.01.23
Как средствми DELPHI *.wav файлы перевести в mp3 формат?


1-72785
Checker
2004-01-13 11:51
2004.01.23
Включение файла данных в проект


14-72910
sancho
2004-01-01 22:49
2004.01.23
Касперский усердно работает..


1-72826
Ivolg
2004-01-12 13:31
2004.01.23
TmainMenu


3-72692
СержК
2003-12-27 09:12
2004.01.23
Перехожу на MSSQL





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский