At 04:27 pm 20.06.01, you wrote:
>Hi,
>Does anyone know if there is any differences in Delpi versions for exception
>handling??
>What is the difference between using 'except' by itself aand using 'except
>on 'exceptionName' do'???
using the try/except by itself and handling the exception will catch and
handle all exceptions. using "on exceptionname" will catch all exceptions
but only handle the named exception.
>I'm having problems with exceptions completely ignoring the handlers.
What happens Sam?
If you create an exception the program flow will jump to the except. If you
have code to handle it then no exception will be raised UNLESS you
specifically call "raise". eg.
try
SomethingStupid;
ShowMessage('Got here');
except
ShowMessage('Oops!');
end;
if SomethingStupid raised an exception, then the message "Oops!" will be shown.
However..
except
ShowMessage('Oops!');
Raise;
end;
will do BOTH show the message "Oops!" then re-raise the exception to show
you the exception.
In both circumstances you will never see the message "Got here"
Perhaps you are using the "On ExceptionName Do" and only checking for
certain exceptions. In this case, if the exception is not one of the named
exceptions, Delphi says that you have handled the exception and will carry
on with the code after the "end;" of the exception.
I almost never use "On ExceptionName Do".
Steve
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"