Autor Beitrag
holgerbremen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120



BeitragVerfasst: Do 14.06.07 07:56 
Hallo,

kann man beim Auftreten einer Exception die Zeilennumme rausfinden, in der die Exception aufgetreten ist.

Gruß
Holger
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Do 14.06.07 10:11 
Wenn man im Debugger auf OK klickt markiert einem Delphi doch normalerweise die Zeile.

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 14.06.07 10:21 
Und zur Laufzeit kannst du das vergessen, denn dann existiert dein Delphi-Code in der geschriebenen/gut lesbaren Form nicht mehr :)

Ich lös das immer so
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
 procedure showFehler(ProFu, Meldung: String);
 begin
  messagebox(application.handle, pchar('Es trat ein Fehler auf:' + #10#13#10#13 + 'Funktion/Prozedure:' + ProFu + #10#13#10#13 + 'Fehler: ' + Meldung), 'Fehler', MB_IconERROR);
 end;

 function BerechneXY(Z: Integer): Integer;
 begin
  try 
   BerechneXY:= 0/z;
  except
   on e: exception do
   begin
    showFehler('XY berechnen', e.Message);
    exit;
   end;
  end;
 end;


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Do 14.06.07 10:52 
Wenn die MAP-Datei dabei ist, geht es schon. Such mal nach MadExcept. Das macht das.

[edit] MadExcept benötigt keine MAP-Datei... [/edit]

_________________
Na denn, dann. Bis dann, denn.
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: So 17.06.07 09:06 
Wenn die Mapfile dabei ist, kann man sich aber anhand der Fehleradresse (die man entweder angezeigt bekommt, oder abfragen kann) die Zeilennummer leicht selber ermitteln. Hab ich hier im Forum schon erklärt, wie das genau geht ...

MadExcept und EurekaLog arbeiten mit den TD32-Debuginfos, die allerdings die EXE wesentlich aufblähen ...

_________________
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.