Autor Beitrag
Timo
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Di 28.09.04 14:43 
Hallo allerseits...
Kann sein das sich diese Frage jetzt ziemlich noobig anhört, aber wie speicher ich Daten vom Typ
"String" ab? wenn sie vom Typ "String[watweisich]" sind, macht er es sofort, weil er weis, wieviel Byte er nun abspeichern muss. Nun ist die größe vom String aber nicht konstant und schon klappts nicht mehr :( .

Hier das was ich bis jetzt fabriziert habe und was net funzt:
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:
// SgEingabee : StringGrid
// DlgSaveProjekt : Save-Dialog
procedure TEngine.SpeichernClick(Sender: TObject);
var
counter : integer;
filehandle : integer;
name,text,mp3pfad : string;
begin
  if DlgSaveProjekt.Execute then
  begin
    filehandle := FileCreate(DlgSaveProjekt.FileName);
    For counter := 1 to SgEingabe.rowcount do
    begin
      If not ((SgEingabe.Cells[1,counter] = '') or (SgEingabe.Cells[2,counter] = '')) then
      begin
        name := SgEingabe.Cells[1,counter] + chr(13) + chr(10);
        text := SgEingabe.Cells[2,counter] + chr(13) + chr(10);
        mp3pfad := SgEingabe.Cells[3,counter] + chr(13) + chr(10);
        FileWrite(fileHandle,name,sizeof(name));
        FileWrite(fileHandle,text,sizeof(text)+4);
        FileWrite(fileHandle,mp3pfad,sizeof(mp3pfad)+4);
      end;
    end;
    FileClose(filehandle);
  end;
end;


Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 28.09.04 15:12 
Hallo!

Schau mal hier herein. :wink:

Cu,
Udontknow
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 28.09.04 15:12 
Stichwörter:
TFileStream, TReader und TWriter

Wenns nicht zu kompliziert wird, nimm ein Textfile!
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Di 28.09.04 15:13 
schau dir mal TWriter und TReader an

[edit]super jetzt war ich sogar schon 2mal zu langsam[/edit]

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Timo Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Di 28.09.04 15:48 
danke Leute :D
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 28.09.04 16:06 
Bitte Haken setzen! :)