trichview.com

trichview.support




Re: SaveTextToStream problems


Return to index


Author

Message

Yoerdes

Posted: 05/25/2003 17:38:46


Thank you for your help.


My code was missing Stream.Position := 0; Now it works too.


Regards

Yoerdes



Muhammad wrote:

> Hi!

> I used this code and it work very well

> var

>     Stream: TMemoryStream;

>     Str: TStringList;

> begin

>     Stream := TMemoryStream.Create;

>     RV.SaveTextToStream('', Stream, 10, False, True);

>     Stream.Position := 0;

>     Str := TStringList.Create;

>     Str.LoadFromStream(Stream);

>     ShowMessage(Str.Text);

>

> and it work well

> regards

>

> "Yoerdes" <nospam@nospam.com> wrote in message

> news:3ED012BD.50401@nospam.com...

>

>>Hi,

>>

>>procedure TForm1.Button1OnClick(Sender: TObject);

>>begin

>>   Label1.Caption := GetPlainText;

>>end;

>>

>>function TForm1.GetPlainText: string;

>>var

>>   Stream: TMemoryStream;

>>   s: string;

>>begin

>>   rve.SaveTextToStream('', Stream, 0, false, true);

>>   SetLength(s, Stream.Size);

>>   Stream.Read(s[1], Stream.Size);

>>   Result := s;

>>end;






Powered by ABC Amber Outlook Express Converter