2006/6/8, Michael Van Canneyt <[EMAIL PROTECTED]>:


On Thu, 8 Jun 2006, Alexandre Leclerc wrote:

> 2006/6/7, Michael Van Canneyt <[EMAIL PROTECTED]>:
> > Var
> > M : TStream;
> > F : Text;
> > l : String;
> >
> > begin
> > M:=TMyStream.Create;
> > Try
> > AssignStream(F,M);
> > Reset(F);
> > // Read your stuff here
> > ReadLn(L,F);
> > Close(F);
> > Finally
> >  FreeAndNil(M);
> >   end;
> > end;
> >
> > This will always work.
>
> This seams to not work:
>
> AssignStream(f, stream); //we do this to be able to use readln
> Append(f);
> try
>  Writeln(f, 'test');
> finally
>  Close(f);
> end;
>
> I have a file not open error. Hum...

Does it work with rewrite ?
Append() really makes no sense in this case.

In this case no, but in fact I'm actually calling many SaveToStrem()
function into the same stream. So they must add to it and not clear
it.

Rewrite causes no problems, but I don't know if it works or not
because TMemoryStrem.SaveToFile() is not saving anything... :S can't
find any file...

--
Alexandre Leclerc

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to