Autor Beitrag
MH1987
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 98



BeitragVerfasst: Mi 27.06.07 15:32 
Hi,

ich habe ein kleines Problem bei dem Speichern von einem Dynamischen Array in eine Textdatei.

hier der quelltext:

ausblenden 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:
  TDatenEintrag = record
                    Kategorie: string;
                    Name: string;
                    ID: ShortInt;
                  end;
  TDaten = array of TDatenEintrag;

[...]

var
  Main: TMain;
  Daten: TDaten;

[...]

procedure TMain.Speichern;
var
  F: Textfile;
  i: integer;
begin
  assignFile(F, 'mat.mdb');
  rewrite(F);
  for i:= 0 to Length(Daten) do begin
    Write(Daten[i].Kategorie,';',Daten[i].Name,';',IntToStr(Daten[i].ID),';');
  end;
  closeFile(F);
end;


wenn ich die procedure ausführe kommt ein fehler... (EAccessViolation)

wo ist der Fehler?

Gruß,
Matthias
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 27.06.07 15:48 
ausblenden Delphi-Quelltext
1:
for i:= 0 to High(Daten) do begin					

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
MH1987 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 98



BeitragVerfasst: Mi 27.06.07 15:52 
super dankeee!

Kenne mich noch nicht so gut mit dynamischen arrays aus....

gruß,
Matthias