Autor Beitrag
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Sa 09.04.05 15:13 
Moin... ;)

Titel klingt vllt. n bissele verrückt, aber macht eigentlich Sinn. :mrgreen: Ich habe folgenden Code-Block:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
try
//blabla
except
//blabla
end;

Jetzt würde ich gerne mit einem Befehl im try-Teil eine Exception auslösen, so dass ich in den except-Teil reinrutsche...

Danke schonmal... ;)
timitio
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 09.04.05 15:20 
Hi,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
try
  raise Exception.Create('Ein schwerer Ausnahmezustand-Fehler!!')
except
  on e: showmessage(e.Message); //<-- bin mir hier nicht so sicher ob es "e.Message" war
end;


Moderiert von user profile iconAXMD: Code- durch Delphi-Tags ersetzt.
WeBsPaCe Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Sa 09.04.05 15:40 
Danke, danke!! :D

Ist auch wurscht... Ich will einfach nur in except rein... ;) Danke! ;)
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: Sa 09.04.05 15:44 
Nicht ganz: On E: Exception do Showmessage({...}.);

Begin-End-Block nach Do möglich.

_________________
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.
WeBsPaCe Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Sa 09.04.05 15:50 
Super. Dann weiß ich das jetzt auch, falls ich's irgendwann brauch... ;)