🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.language.objectpascal
Article #213

Re: RichEdit and Streams

#213
From: Yehia Ahmed
Date: Mon, 26 Jan 2004 18:36
33 lines
1838 bytes
anyone?

"Yehia Ahmed" <yehiaeg@hotmail.com> wrote in message
news:4014d318@newsgroups.borland.com...
> hello;
>
> I read about tsreams object and how to modify the rtf code of the richedit
> control,
> as this we too complicated for me, i tried to load the rtf code in a
> memo,modify it, and then use the save to strem to return back to richedit,
>
> var Reg:Tregistry;
>     SS:TstringStream;
>     ReStr : Tmemo;
> begin
> ReStr:=    tmemo.Create(form1);
> SS := tstringstream.Create('');
> form1.MainText.Lines.SaveToStream(ss);
> ReStr.Text := ss.datastring;
> ReStr.Text := stringReplace(restr.Text,'Courier New','Tahoma',[]);
> ss.Position := 0;
> ss.WriteString(restr.Text ) ;
> form1.MainText.Lines.LoadFromStream(ss);
>
> the problem is in the last line, when executed the richedit text becomes
'',
> although the ss.datastring contain the right code, so why is this
happening,
>
> Thanks
> Yehia
>
>
Technical Details
Message-ID: <40155e16@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4014d318@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d30,b3adc9c135a2402
X-Google-Attributes: gid109d30,public
X-Google-ArrivalTime: 2004-01-26 10:41:02 PST
From: "Yehia Ahmed" <yehiaeg@hotmail.com>
Newsgroups: borland.public.delphi.language.objectpascal
References: <4014d318@newsgroups.borland.com>
Subject: Re: RichEdit and Streams
Date: Mon, 26 Jan 2004 20:36:00 +0200
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
NNTP-Posting-Host: 62.68.242.119
Message-ID: <40155e16@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1075142166 62.68.242.119 (26 Jan 2004 10:36:06 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail