Autor Beitrag
spacerunner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 10.10.06 16:33 
Hallo,

ich habe folgende datenstruktur
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 TMyRecord = record
  name: string;
  stream: TStream;
  ...

  TMyArray = array of TMyRecord


und möchte dieses array gerne in einem stream ablegen. ist das möglich?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 10.10.06 16:45 
Moin!

Ja, das ist möglich. Allerdings mußt du alle Elemente des records in der gewünschten Reihenfolge in den Stream schreiben. Es ist (allgemein) nicht möglich, das ganze über eine Buffer-Methode und der record-Adresse abzuwickeln, da du dynamische Objekte verwendest (String, TStream). Deren Daten liegen aber auf dem Heap und nicht innerhalb des record-Speicherbereichs.

FAQ-Beitrag dazu (geht da zwar konkret um Netzwerkdatenübertragung, aber das Problem ist das gleiche). ;)

cu
Narses

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