Autor Beitrag
mustermannxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 20

WinXP prof
Delphi 2005 Pers
BeitragVerfasst: Di 27.09.05 15:37 
hi,
hab da ein problem an dem sitz ich jetzt schon 2 tage, kann den fehler einfach nicht finden.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TInisk.writeplayer(const player :string);
var i : integer;
begin
  skdat := TIniFile.Create(ExtractFilePath(ParamStr(0)) +'skaterg.ini');
  skini.createini;
  try
    i := skdat.ReadInteger('algemein','spieler', 0) + 1;
    skdat.WriteInteger('algemein','spieler',i);
    skdat.WriteInteger('spieler',player,i);


das geht dann noch bissel so weiter. nachdem ichs compieliert hab und versuche das prog zu nutzen sagt der mir das eine zugriffsverletzung aufgetreten sei. ich hab das schon x-mal durch probiert und einige teile auch mal in andere proceduren gesetzt wo sie einwandfrei funtzten.
mfg mustermannxx
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 27.09.05 15:39 
Was passiert denn bei skini.createini;?

_________________
We are, we were and will not be.
mustermannxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 20

WinXP prof
Delphi 2005 Pers
BeitragVerfasst: Di 27.09.05 15:40 
ist für das teil unbedeutend, das funtzt auch ohne probleme.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 27.09.05 15:42 
Was ich wissen wollte ist, ob die Zugriffsverletzung evtl. dort passiert :roll: - bei dem anderen sehe ich keinen Fehler...

_________________
We are, we were and will not be.
mustermannxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 20

WinXP prof
Delphi 2005 Pers
BeitragVerfasst: Di 27.09.05 15:46 
ne die ist genau so aufgebaut wie die hier ich kann die aber gerne mal rein setzen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TInisk.createini;
begin
  skdat := TIniFile.Create(ExtractFilePath(ParamStr(0)) +'skaterg.ini');
  try
    if not skdat.SectionExists('algemein') then
    begin
      skdat.WriteInteger('algemein','spieler',0);
      noch einige andere werte die gesetzt werde
      skdat.WriteInteger('gesamt','tkaro', 0);
    end;
  finally
    skdat.Free;
  end;
end;





ahhhhhhhhhhhhhh ich glaub ich hab ihn grade entdeckt. ich lasse skini.creatini machen nachdem ich die ini öffnen lassen habe und so die ini wieder schließe
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 27.09.05 15:49 
Tja, das dürfte dann an der globalen Variable skdat liegen, die in TInisk.createini; zum Ende freigegeben wird. Ein Zugriff danach ist dann nicht mehr wirklich sinnvoll. Das die vorher zweimal creiert wurde, ist dabei egal.

Edit: Schön, wenn man den Fehler selber findet, oder? :D

_________________
We are, we were and will not be.
mustermannxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 20

WinXP prof
Delphi 2005 Pers
BeitragVerfasst: Di 27.09.05 15:51 
jo habs gemerkt, vielen vielen dank für die hilfe, ich glaub mir wäre das ohne dich nie aufgefallen :D
riesen thx mustermannxx