Hi all,
How do I trap EInOutError exceptions when I use the
TMemo.Lines.LoadFromFile method ??
I tried this:
try
FName := OpenRtf.FileName;
Memo1.Lines.LoadFromFile(FName);
Except
on E: EInOutError do
begin
MessageDlg(E.Message,mtInformation,[mbOk],0);
end;
end;
Compiles fine, but when I run try to load the memo from a non-existing file
I get a standard Delphi MessageBox (i.e. Caption=Apllication.Title,
Text='Cannot open ...',and a STOP-Icon).
Any suggestions here ? I need to be able to know wether the LoadFromFile or
the SaveToFile has been succesfull.
Greetings,
Bart
--------------------------------------
Bart Broersma
broersma@knmg.nl
* Wave Rider 1.20 [NR] *
... UNREGISTERED EVALUATION COPY
--- Wave Rider v1.20
---------------
* Origin: Aargh! BBS Amsterdam (2:280/606)
|