Autor Beitrag
nilsener1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

Win 98, XP
D4 prof.
BeitragVerfasst: Do 23.02.06 21:55 
Hallo,

ich brauche eine Kontrolle ob meine Dekomprimierung mit DeCompressFile (zlib) erfolgreich ausgeführt wurde, wie kann ich das lösen?

ausblenden Delphi-Quelltext
1:
status:=DeCompressFile('c:\test002.dat');					


läuft nicht mit der Fehlermeldung:

[Error] Unit1.pas(3102): Incompatible types: 'Integer' and 'procedure, untyped pointer or untyped parameter'

da DeCompressFile offensichtlich eine Procedure ist und keine Function.

Hat da jemand eine Idee?

Gruss Nilsener
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 23.02.06 22:04 
Entweder ZLib-Source nehmen und umprogrammieren, dass Dir ein Status gegeben wird
ODER ne Prüfsumme berechnen, und vergleichen, ob die mit dem Erwartungswert der dekomprimierten Daten übereinstimmt.

Ansonsten:
Keine Exception: Alles in Ordnung
Exception: Ein Fehler ist aufgetreten ...

Reicht Dir das nicht als Status *g*

_________________
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.
nilsener1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

Win 98, XP
D4 prof.
BeitragVerfasst: Do 23.02.06 22:12 
Hallo BenBE,

ich glaube das mit dem Exception würde mir reichen. Bei fehlerhafter Dekomprimierung kann mein Programm zwangsbeendet werden, ging das nicht mit Exception???
Kannst Du mir ein kurzes Beispiel geben wie ich das dann programmieren muss?!

Gruss Nilsener
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 23.02.06 22:20 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Try
    DecompressFile('C:\1337.txt');
except
    Halt; //Programm RADIKAL beenden
    Application.Terminate; //Anwendung gesittet beenden
    Exit; //Prozedur beenden
end;


Eine der 3 Zeilen in Except reicht vollkommen.

_________________
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.
nilsener1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

Win 98, XP
D4 prof.
BeitragVerfasst: Do 23.02.06 22:25 
Hallo BenBE,

ich werde das so einbauen und entscheide mich für Application.Terminate :)

Prima Hilfe, ich danke Dir sehr!!

Gruss nilsener
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 23.02.06 22:29 
Hinweis: Wenn Du Application.Terminate nutzt, wird die aktuelle Prozedur noch bis zum Ende weiter abgearbeitet. In diesem Fall brauchst Du also zusätzlich auch den Befehl Exit, wenn dies nicht geschehen soll.

_________________
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.
nilsener1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

Win 98, XP
D4 prof.
BeitragVerfasst: Do 23.02.06 22:39 
au danke, das darf nämlich dann auf keinen fall passieren. werde exit einbauen. danke!