Autor Beitrag
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Di 06.07.04 18:23 
Hallo,
wie kann ich folgenden Code ohne SysUtils schreiben?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
try
 i:=0;
 i:=4 div i;
 Tag:=i;
 Caption:='Hat geklappt';
except
 on Exception do ;
end;

Danke schon mal,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Di 06.07.04 22:37 
mhh.....
ich kenn mich da zwar nicht so gut aus, aber wenn du es WIRKLICH ohne sysUtils willst (warum eigentlich??) würde ich die Exception-Behandlung von Windows & damit von deinem Programm aufheben (Frag mich jetzt net wie das geht :wink:) und bei jeder Funktion / Prozedur überprüfen, ob sie korrekt ausgeführt wurde (mir fällt jetzt nichts besseres ein, als eine IF-Schleife :roll:)

Alstar
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mi 07.07.04 10:20 
:D Habs grad mal getestet...es geht in der tat. Hätte ich auch nicht gedacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  try
    raise TObject.create;
  except
    on E:TObject do ShowMessage('error');
  end;


Kannst dir dann quasi deine eine exception archtitektur schreiben und einen standard ErrorHandler etc implementieren

_________________
mfg.
mâximôv
maxk Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 07.07.04 16:46 
Danke, das ist Cool 8)

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.