Autor Beitrag
HBriele
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80



BeitragVerfasst: Mi 03.08.05 23:05 
:?:

Hallo,
weis jemand, wie ich ein except-Anweisung abfrage?
Ich benutze folgende Anweisung zum kopieren!
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
 try
   DataFile:=TMemoryStream.Create;         
   DataFile.LoadFromFile(FSorce);
   DataFile.SaveToFile(FDest);
 finally
   DataFile.Free;
 end;


Ist nun aber die Disk Voll, bekomme ich eine Fehlermeldung.
Wie kann ich das Abfangen ohne das mein Programm hängt ?

Gruß

Moderiert von user profile iconmatze: Code- durch Delphi-Tags ersetzt.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 04.08.05 01:23 
1. Objekt-Initialisierungen gehören VOR den Try-Finally-Block
2. Keine Dateien VOLLSTÄNDIG in TMemory-Streams laden, deren Größe nicht geprüft wird.
3. In Zeile 3 ein try ergänzen
4. In Zeile 7 ein except ShowMessage('Fehler!!!'); end; ergänzen
5. Über Ergebnis freuen!

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.