Thema: Delphi read from multiple Files

Einzelnen Beitrag anzeigen


Registriert seit: 6. Mai 2005
Ort: Berlin
4.956 Beiträge
Delphi 2007 Enterprise

Re: read from multiple Files

  Alt 25. Mär 2009, 17:54

I'm sorry, I don't know what you want. Your code sample does not show what you tried and what you want to achieve. Do you want to load the contents of many file into one stream? This can be achieved by adding the contents to the end of the memory stream.
Procedure AddFileToStream (aStream : TStream; aFile : String);
  filestream : TFileStream;

  filestream := TFileStream.Create (aFile, fmOpenRead);
    aStream.CopyFrom (filestream, filestream.Size);
Btw: In your code sample, you don't have to set any of the 'Size' or 'Position' properties. This is done by the constructor and the CopyFrom method, by setting the Size-parameter to 0.

"Wenn ist das Nunstruck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput!"
(Monty Python "Joke Warefare")
  Mit Zitat antworten Zitat