Autor Beitrag
spongeBHV
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Sa 07.10.06 14:26 
JIPPI! Speichern tut er schonmal! Nur leider nicht in dem format wie ich es will und wie er es braucht zum später wieder richtig einlesen. So soll die txt- Datein dann eigentlich aussehen:

WERT1 WERT2 WERT3 WERT4 WERT5 WERT6
WERT7 WERT8 WERT9 WERT0 ...

und so weiter. Soll heißen, er soll die Daten aus dem Stringgrid Zeilenweise auslesen und in die textdatei schreiben und dabei die zellenwerte durch ein leerzeichen trennen. Kommt die nächste Zeile soll er die in der selben weise darunter schreiben und so weiter.

bei meinem quelltext (siehe unten) schreibt er alle ausgelesenen werte jeweils in eine neue zeile, dass es dann so aussieht:

WERT1
WERT2
WERT3
WERT4
...

und so weiter. was muss ich in der speichernprozedur ändern?
ausblenden volle Höhe 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:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
procedure TForm1.SB_savePolsterClick(Sender: TObject);
var
Datei : Textfile;
begin

  if ( SaveDialog1.Execute )
  then
  AssignFile(Datei,SaveDialog1.filename); //Zuweisung des Pfades
  Rewrite(Datei);  //Erstellt neue Datei und öffnet diese anschließend
  Writeln(Datei,Polstertabelle.Cells[11]);
  Writeln(Datei,Polstertabelle.Cells[21]);
  Writeln(Datei,Polstertabelle.Cells[31]);
  Writeln(Datei,Polstertabelle.Cells[41]);
  Writeln(Datei,Polstertabelle.Cells[51]);
  Writeln(Datei,Polstertabelle.Cells[61]);

  Writeln(Datei,Polstertabelle.Cells[12]);
  Writeln(Datei,Polstertabelle.Cells[22]);
  Writeln(Datei,Polstertabelle.Cells[32]);
  Writeln(Datei,Polstertabelle.Cells[42]);
  Writeln(Datei,Polstertabelle.Cells[52]);
  Writeln(Datei,Polstertabelle.Cells[62]);

  Writeln(Datei,Polstertabelle.Cells[13]);
  Writeln(Datei,Polstertabelle.Cells[23]);
  Writeln(Datei,Polstertabelle.Cells[33]);
  Writeln(Datei,Polstertabelle.Cells[43]);
  Writeln(Datei,Polstertabelle.Cells[53]);
  Writeln(Datei,Polstertabelle.Cells[63]);

  Writeln(Datei,Polstertabelle.Cells[14]);
  Writeln(Datei,Polstertabelle.Cells[24]);
  Writeln(Datei,Polstertabelle.Cells[34]);
  Writeln(Datei,Polstertabelle.Cells[44]);
  Writeln(Datei,Polstertabelle.Cells[54]);
  Writeln(Datei,Polstertabelle.Cells[64]);

  Writeln(Datei,Polstertabelle.Cells[15]);
  Writeln(Datei,Polstertabelle.Cells[25]);
  Writeln(Datei,Polstertabelle.Cells[35]);
  Writeln(Datei,Polstertabelle.Cells[45]);
  Writeln(Datei,Polstertabelle.Cells[55]);
  Writeln(Datei,Polstertabelle.Cells[65]);

  Writeln(Datei,Polstertabelle.Cells[16]);
  Writeln(Datei,Polstertabelle.Cells[26]);
  Writeln(Datei,Polstertabelle.Cells[36]);
  Writeln(Datei,Polstertabelle.Cells[46]);
  Writeln(Datei,Polstertabelle.Cells[56]);
  Writeln(Datei,Polstertabelle.Cells[66]);

  Writeln(Datei,Polstertabelle.Cells[17]);
  Writeln(Datei,Polstertabelle.Cells[27]);
  Writeln(Datei,Polstertabelle.Cells[37]);
  Writeln(Datei,Polstertabelle.Cells[47]);
  Writeln(Datei,Polstertabelle.Cells[57]);
  Writeln(Datei,Polstertabelle.Cells[67]);

  Writeln(Datei,Polstertabelle.Cells[18]);
  Writeln(Datei,Polstertabelle.Cells[28]);
  Writeln(Datei,Polstertabelle.Cells[38]);
  Writeln(Datei,Polstertabelle.Cells[48]);
  Writeln(Datei,Polstertabelle.Cells[58]);
  Writeln(Datei,Polstertabelle.Cells[68]);

  Writeln(Datei,Polstertabelle.Cells[19]);
  Writeln(Datei,Polstertabelle.Cells[29]);
  Writeln(Datei,Polstertabelle.Cells[39]);
  Writeln(Datei,Polstertabelle.Cells[49]);
  Writeln(Datei,Polstertabelle.Cells[59]);
  Writeln(Datei,Polstertabelle.Cells[69]);

  Writeln(Datei,Polstertabelle.Cells[110]);
  Writeln(Datei,Polstertabelle.Cells[210]);
  Writeln(Datei,Polstertabelle.Cells[310]);
  Writeln(Datei,Polstertabelle.Cells[410]);
  Writeln(Datei,Polstertabelle.Cells[510]);
  Writeln(Datei,Polstertabelle.Cells[610]);
  CloseFile(Datei);

end;



kann mir jemand sagen, wie ich das richtig machen kann? auch gern mit variablen, das das nicht so ein ewig langer quelltext wird...

danke schonmal, stefan
gsmgrufti
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22


Delphi 7 Prof, BDS2006 rof
BeitragVerfasst: Sa 07.10.06 14:33 
Hatte ich dir in deinen vorherigen Thread gepostet :wink:
spongeBHV Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Sa 07.10.06 14:41 
du hast mir viel gepostet, weiß deshalb nicht von welchem beitrag ich etwas entnehmen soll, was dieses problem behebt! sorry :oops: :nixweiss: :nut: :?!?: :?: :(