El 04/09/2016 a las 19:17, Marcos Douglas escribió:

  try
    Buf.LoadFromFile('data.txt');
    showmessage(inttostr(ExtractStream(Buf, Buf2))); //<< result is 0, ie, OK
    Buf2.SaveToFile('result.txt');

There is no error, but Buf2 is empty.

Hello,

I'm not sure but I think that code at least should look like:

  try
    Buf.LoadFromFile('data.txt');
--->>>>  Buf.Position:=0;
    showmessage(inttostr(ExtractStream(Buf, Buf2)));
    Buf2.SaveToFile('result.txt');

Because I think the stream position is just at the end after LoadFromFile.


--

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to