Autor Beitrag
delphistart
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 119



BeitragVerfasst: Sa 23.12.06 15:13 
Hallo, hat jemand von euch eine Idee, warum der Error "Zugriffsverletzung" in dieser Abfrage auftritt bzw. auftreten könnte?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
    if test=true then
      begin
        if arrLabel15[count].Caption[8]='0' then data.bestand:=data.bestand+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='1' then data.bk1:=data.bk1+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='2' then data.bk2:=data.bk2+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='3' then data.bk3:=data.bk3+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='4' then data.bk4:=data.bk4+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='5' then data.bk5:=data.bk5+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='6' then data.bk6:=data.bk6+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='7' then data.bk7:=data.bk7+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='8' then data.bk8:=data.bk8+StrToInt(arredit1[i].Text)
        else if arrLabel15[count].Caption[8]='9' then data.bk9:=data.bk9+StrToInt(arredit1[i].Text)
        else ShowMessage('ERROR: FEHLER BEI AUSWERTUNG DER LISTE');
        Reset(datei3);
        seek(datei3,0);
        write(datei3,data);
        closeFile(datei3);
      end;
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Sa 23.12.06 15:16 
existiert datei3??
is sie geöffnet??

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
delphistart Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 119



BeitragVerfasst: Sa 23.12.06 15:20 
ja... Der Compiller beschwert sich über die Zeile
ausblenden Delphi-Quelltext
1:
if arrLabel15[count].Caption[8]='0' then data.bestand:=data.bestand+StrToInt(arredit1[i].Text)					
aim65
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 312

Win 9x, Win XP
Delphi 3pro, 7PE
BeitragVerfasst: Sa 23.12.06 15:22 
"[i]" im definierten Bereich?
delphistart Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 119



BeitragVerfasst: Sa 23.12.06 15:24 
user profile iconaim65 hat folgendes geschrieben:
"[i]" im definierten Bereich?

Ja ist ebenfalls gegeben. Wird in der procedur deklariert...
aim65
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 312

Win 9x, Win XP
Delphi 3pro, 7PE
BeitragVerfasst: Sa 23.12.06 15:41 
Wenn Du de erste Zeile wegläßt - geht dann der Rest? Was ist mit [count]? Sonst fällt mir nix mehr ein. :roll:
delphistart Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 119



BeitragVerfasst: Sa 23.12.06 17:05 
user profile iconaim65 hat folgendes geschrieben:
Wenn Du de erste Zeile wegläßt - geht dann der Rest? Was ist mit [count]? Sonst fällt mir nix mehr ein. :roll:


Ist mir ja direkt peinlich... :oops: :oops::oops::oops:
Das mit dem Count muss natürlich i heißen. Sorry das ich euch mit so einem einfachen Fehler generft habe...
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Sa 23.12.06 22:05 
macht nix! waren schon blödere probs.

kleiner Tipp: nimm ne CASE anweisung.

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
delphistart Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 119



BeitragVerfasst: So 24.12.06 00:08 
user profile iconelundril hat folgendes geschrieben:
macht nix! waren schon blödere probs.

kleiner Tipp: nimm ne CASE anweisung.

lg el


Danke für den Hinweis... Habe ich auch gleich umgesetzt!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 24.12.06 00:21 
ausblenden Delphi-Quelltext
1:
if test=true then					

kann auch zu
ausblenden Delphi-Quelltext
1:
if test then					

verkürzt werden.

_________________
Markus Kinzler.