Board index » delphi » PLEASE HELP: Exception handler is not working !

PLEASE HELP: Exception handler is not working !

Dear Delphi users,

I got the following exception handler:

try
  AssignFile(F,'A.A');
  Reset(F);
  try
    Read(F, A);
  finally
    Close(F);
    Application.Terminate;
  end;
except
  on EInOutError do begin
     MessageDlg('.....', ...);
     Application.Terminate;
  end;
end;

The file 'A.A' does not exist, and the application is terminating with a
message:

"Application AAA.EXE raised exception class EInOutError with message 'File not
found'. Process stopped."

Why doesn't the exception handler handles the exception? Can someone please
help me?

Many thanks

Anton Feiertag, <dok...@iafrica.com>

 

Re:PLEASE HELP: Exception handler is not working !


I do not know if this is the case or not, but I have found that unless you
have the break on exception option set to false, Delphi will still raise
the error while you are running the program from with in Delphi.  An easy
way to test this would be compile the project and run the .exe from outside
of delphi.  If it gives you the desired result then you have no problem,
the try except is working just fine.

Good Luck,

Brian English
bri...@vision911.com

Re:PLEASE HELP: Exception handler is not working !


Hello Dokker!

Monday April 07 1997, Dokker wrote to All:

 D> "Application AAA.EXE raised exception class EInOutError with message 'File
 D> not found'. Process stopped."
 D> Why doesn't the exception handler handles the exception? Can someone
 D> please help me?

Try to run your program outside the IDE is not appearing.

Kind regards Ole

    E-Mail: Ole_Morten...@Hotmail.com

Other Threads