TRichViewEdit.Format gives 'list index out of bound'

General TRichView support forum. Please post your questions here
Post Reply
chys
Posts: 3
Joined: Wed Sep 17, 2008 11:54 am

TRichViewEdit.Format gives 'list index out of bound'

Post by chys »

Hello!

Have a question about TRichViewEdit (using v1.9.47).

RVE1,RVE2,RVE3: TRichViewEdit;

I need to save data from RVE1 & RVE2 into a stream and then load data from this stream into another RVE3. I get a "list index out of bound" when I format RVE3.

<<source is below>>

RVE1.SaveRVFToStream(stream,false);
RVE2.SaveRVFToStream(stream,false);
...
stream.position := 0
RVE3.LoadRVFFromStream(stream);
RVE3.Format;
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You cannot concatenate to RVF files that simple, by saving two RichViews in the same stream. The resulting stream content is invalid.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use the following code to copy RVE1+RVE2 in RVE3:

Code: Select all

Stream := TMemoryStream.Create;
RVE1.SaveRVFToStream(Stream,False); 
Stream.Position := 0;
RVE3.LoadRVFFromStream(Stream); 

Stream.Clear;
RVE2.SaveRVFToStream(Stream,False); 
Stream.Position := 0;
RVE3.InsertRVFFromStream(Stream, RVE3.ItemCount);

RVE3.Format;
Stream.Free;
chys
Posts: 3
Joined: Wed Sep 17, 2008 11:54 am

Post by chys »

Sergey Tkachenko wrote:Use the following code to copy RVE1+RVE2 in RVE3:
...
Thanks!
Post Reply