Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 19.05.05 12:59 
Kann ich von der Adresse die mir mein Programm bei einer Exception anzeigt auf die CodeZeile Schliessen??
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Do 19.05.05 13:10 
wenn es eine exception aus dem speicherbereich deiner exe ist schon.

dieser wird bei ~ 00400000 liegen
dann mahctse ab delphi 5 (?) einfach einen breakpoint bei form1.create
drückst dann alt+strg+c dann kommste in das code fenster
dann drückste strg+g und gibstdie adresse mit führendem dollarzeichen an z.b. $00401234

anhand des assemblercodes und des delphicodes kannste dann rausfinden wo die excpetion aufgetreten ist

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 19.05.05 13:17 
Bei normalen Exceptions normalerweise nicht... wenn du mit Delphi-Bordmitteln arbeiten willst solltest du dir mal Asserts anschauen.. ansonsten kann ich dir noch madExcept empfehlen: www.madshi.net

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 19.05.05 13:19 
Das Poblem ist, bei tritt immer ne EAccessViolation auf, aber erst nach ca. 30min testen.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Do 19.05.05 13:22 
Dann würd ich mir mal madExcept holen und damit testen... das liefert dir die exakte Zeile und den gesamten CallStack...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 19.05.05 13:49 
wenn ich das grad richtig gesehn hab müsste in dieser Prozedur die Exeption auftreten:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
procedure Tfrm_Verwalt.btAddMAKenntnisseClick(Sender: TObject);
var sqlstatement: string;
    i, j, max :Integer;
    selection : array of String;
    variable: boolean;
begin

If spbtCommitAll.Enabled then
begin
     ShowMessage('Bitte speichern Sie erst die Änderungen');
     exit;
end;
//maximale Arraygröße ermitteln
max := dbgKenntnisse.SelectedRows.Count + dbgSprache.SelectedRows.Count;
//max. Arraygröße setzen
SetLength(selection,max);

//Array mit Kenntnr aus Kenntnisse füllen
with dbgKenntnisse.dataSource.DataSet do
begin
  for i:=0 to dbgKenntnisse.SelectedRows.Count-1 do
  begin
        GotoBookmark(pointer(dbgKenntnisse.SelectedRows.Items[i]));
        selection[i] := FieldByName('KENTNR').asstring ;
  end;
end;


// wurde für i-bereich nichts ausgewählt i mit 0 initialisieren
if dbgKenntnisse.SelectedRows.Count = 0 then
begin
   i:=0;
end;



//Array mit Kenntnr aus Sprachen füllen
with dbgSprache.dataSource.DataSet do
begin
  for j:=0 to dbgSprache.SelectedRows.Count-1 do
  begin
        GotoBookmark(pointer(dbgSprache.SelectedRows.Items[j]));
        selection[i + j] := FieldByName('KENTNR').asstring ;
  end;
end;

//in einer Schleife Werte eintragen
for i:=0 to max-1 do
begin
    sqlstatement := 'select count(*) as reccount from MAKenntnisse ' +
                    'where MANr='+ dbeMAnr.Text +
                    ' and KENTNr=' + selection[i] + '';

    with dmMesse.qrySpezialisten do
    begin
      Close;
      SQL.Clear;
      SQL.Add(sqlstatement);
      open;
      end;
      if dmMesse.qrySpezialisten.FieldByName('reccount').asinteger=0 then
      begin
        with dmMesse.IBSQL1 do
        begin
          sqlstatement := 'INSERT INTO MAKENNTNISSE(MANR,KENTNR) ' +
                      'VALUES (' + dbeMAnr.Text + ', ' + selection[i] + ');';
          Close;
          SQL.Clear;
          SQL.Add(sqlstatement);
        try
          ExecQuery;
        except
        continue;
      end;
    end;
    end;
    try
      begin
      dmMesse.IBTransaction1.CommitRetaining;
      end;
    except
      begin
      dmMesse.IBTransaction1.RollbackRetaining;
      exit;
      end;
    end; //try
end;     //for
//Selektion löschen
dbgSprache.SelectedRows.Clear;
dbgKenntnisse.SelectedRows.Clear;

//Ansicht aktualisieren
prc_CommitAll;
spbtCommitAll.Enabled := false;
tbrueckgaengig.Enabled := false;
end;

ich find nur dummerweise nix, was dazu führen könnte.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 19.05.05 13:56 
Ich tippe mal ganz spontan auf Zeile 43; Delphi müsste doch eigentlich melden, dass i nach der vorherigen Schleife uU undefiniert ist. Hab grad kein Delphi da, kann's also nicht testen.

AXMD
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 19.05.05 14:25 
Stimmt, Stimmt. Dann werd ich mal schauen wie ich i belegen muss, dass die Exception nicht mehr auftritt.
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 19.05.05 14:31 
ok, habs jetzt auf
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if dbgKenntnisse.SelectedRows.Count = 0 then
   i:=0
else
 i := dbgKenntnisse.SelectedRows.Count -1;

geändert, jetzt müsste das klappen.