Autor Beitrag
Stauch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 140

Win 2000, Win XP
D4
BeitragVerfasst: Mi 23.06.04 09:32 
Beim Lesen aus einer Ini-Datei bekomme ich immer eine Zugriffsverletzung.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TGroupTable.ReadIni(var aIni:TIniFile);
     var i: byte;
     var sektor:string;
     var aTeam:TTeam;

    begin 
    aIni:=TIniFile.Create(ExtractFilePath(Application.Exename) + groupname+'.ini');
      try
      for i:= 1 to 4 do
      begin
      sektor:= 'team'+IntToStr(i);
      aTeam.team:=aIni.ReadString(sektor,'team','');
      aTeam.games:=aIni.ReadInteger(sektor,'games',0);
      aTeam.points:=aIni.ReadInteger(sektor,'points',0); ...
      finally
      Ini.Free;
      end;
    end;


Die Ini ist vorhanden (wird mit Fileexists abgecheckt) und hat folgendes Aussehen
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
[team1]
team=Portugal
games=0
points=0
...
[team2]
team=Russland
games=0
points=0
...


Wo könnte der verflixte Fehler stecken???
Danke für alle Hinweise.

_________________
Geht das? Und wenn ja, warum nicht?
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 23.06.04 09:39 
Ist TTeam eine Klasse oder ein Recordtyp? Wenn es ersteres ist, musst du ATeam erst erstellen.

ausblenden Delphi-Quelltext
1:
ATeam:=TTeam.Create;					


Cu,
Udontknow
Stauch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 140

Win 2000, Win XP
D4
BeitragVerfasst: Mi 23.06.04 09:52 
Yep. Das wars. TTeam ist ein Klasse.
Danke

_________________
Geht das? Und wenn ja, warum nicht?