Autor Beitrag
rizor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Mo 23.04.07 19:35 
Hi,

ich speichere eine Datei durch einen Filestream.
Nun möchte ich zwei Arrays, die in einem Record stehen damit speichern.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
 for i := 0 to 30 do
      stream.Write(Kerosin.PreisMon[i], Kerosin.PreisMon[i]);
 for i := 0 to 11 do
      stream.Write(Kerosin.PreisJahr[i], Kerosin.PreisJahr[i]);


So sah meine Idee aus, nur leider werden die Werte nicht gespeichert.
Ich habe im Debugger auch keinen Fehler gefunden.

Könnt ihr mir helfen?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 23.04.07 19:42 
Moin!

Schonmal in die Suche geschaut? ;) Suche in: Delphi-Forum, Delphi-Library ARRAY FILESTREAM SPEICHERN

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
rizor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 209

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Mo 23.04.07 19:55 
Das hilft mir leider nicht, da ich mein Problem nicht im geringsten eingrenzen kann.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 23.04.07 20:25 
Moin!

user profile iconrizor hat folgendes geschrieben:
Das hilft mir leider nicht, da ich mein Problem nicht im geringsten eingrenzen kann.

Und du bist sicher, dass du mit TFileStreamnicht vielleicht etwas überfordert bist? :gruebel: Eventuell wäre ja ein Tag-basiertes Format doch besser gewesen? :?

Schauen wir doch mal in die Hilfe zu TFileStream.Write: ;)
DOH hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
function Write(const Buffer; Count: Longint): Longint;					

Du hast da stehen:
user profile iconrizor hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
stream.Write(Kerosin.PreisMon[i], Kerosin.PreisMon[i]);					

Was fällt uns auf? Du übergibst 2x den gleichen Parameter an Write, aber das kann ja nicht korrekt sein, denn der 2. Parameter soll ja die DATENMENGE angeben! :mahn: Vielleicht fehlt da ja noch was? :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
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: Mo 23.04.07 20:28 
Ich werfe mal einfach das Wort size in den Raum. :lol:

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

WIN XP
Delphi 2005 PE, Visual C++
BeitragVerfasst: Mo 23.04.07 21:56 
hmm...
Manchmal bin ich wie vernagelt.
Danke
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 23.04.07 22:24 
Moin!

Da du den Thread nicht als gelöst markiert hast: heißt das jetzt, du weißt immer noch nicht, warum das nicht geht oder hast du nur die Markierung vergessen? :?!?:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.