Quoting a message from Bryan Smith to Bart Broersma
BS>MSGID: 1:249/109.11 5aa050ff
BS>On 23 Mar 97 Bart Broersma said to All...
BB> How do I trap EInOutError exceptions when I use the
BB> TMemo.Lines.LoadFromFile method ??
BB> Any suggestions here ? I need to be able to know wether the
BB> LoadFromFile or the SaveToFile has been succesfull.
BS>Instead of trying to trap the exception, why not stop the problem befor
BS>occurs ? i.e., check for the presence of the file.
BS>In Delphi 1, that would be ...
BS>if FileSearch(f1Name,'') = '' then { f1Name is name of file }
BS>begin
BS> { handle problem of missing file }
BS>end ;
This however will not solve the problems of
- files > 32K
- disk read errors
- other failures in reading the file.
What's more, I dont want the users to see this nagging default exception
handler.
Should I replace the LoadFromFile method with my own ??
C.U.
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)
|