Autor Beitrag
Lurnon
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 33



BeitragVerfasst: Di 12.09.06 16:01 
Hallo,
mein Problem ist folgendes:
Ich habe in meinem Programm folgenden 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:
private
     sd: record
      spielfeld:array[1..2,1..30,1..20] of integer;
      ue_set:string[50];
     end;


...


procedure TForm1.SpeichernClick(Sender: TObject);
var spei: file of record
      spielfeld:array[1..2,1..30,1..20] of integer;
      ue_set:string[50];
     end;
begin
  Karte_speichern.Execute;
  FileCreate(karte_speichern.FileName);
  AssignFile(spei, karte_speichern.FileName);
  write(spei, sd);
end;


Eigentlich wollte ich dadurch ein Speichern des sd record in eine Datei ermöglichen jedoch funktioniert es nicht (Fehlermeldung beim compilieren)

Was mache ich falsch?

Danke im vorraus,
Lurnon
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Di 12.09.06 16:36 
Hallo,

da ist so einiges schiefgelaufen. Da fehlt es wohl noch an den Grundlagen:
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:
type
     sd = record
      spielfeld:array[1..2,1..30,1..20] of integer;
      ue_set:string[50];
     end;


procedure TForm1.Button1Click(Sender: TObject);
var
  spei: file of sd;
  a: sd;

begin
  //a ist vom Typ sd
  //a muss mit werten besetzt werden
  //a.ue_set := 'test';
  if arte_speichern.Execute then begin
  //wenn ok gedrückt wurde
    AssignFile(spei, arte_speichern.FileName);
    Rewrite(spei);
    Write(spei, a);
    CloseFile(spei);
  end;

end;
Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Lurnon Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 33



BeitragVerfasst: Di 12.09.06 17:03 
Ah, jetzt verstehe ich.
Danke vielmals, Problem gelöst!
Beutel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 89

WIN XP

BeitragVerfasst: Di 10.10.06 22:29 
So Ich habe dazu noch eine Frage wie sieht dann Die Procedur aus wenn du es wieder einliesst?

M.f.G.
Beutel