AppendFrom without causing a new line

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

AppendFrom without causing a new line

Post by DickBryant »

I'm assembling the contents to be displayed in a rve from two sources, as follows:

PQAURec^.MainText.AddTextNLA('1. ',0,0,0);
PQAURec^.MainText.AppendFrom(GetRandomizedMC(i));
PQAURec^.MainText.AddTextNLA(StrPas(CRLF),0,-1,0);

Where PQAURec^.MainText is type TRVTableCellData and GetRandomizedMC is a function that returns type TRVTableCellData. The code ALMOST works as I wish except that instead of

1. Return Value Of GetRandomizedMC

I get

1.
Return Value Of GetRandomizedMC

Is there a way to place the "1. " ahead of the value of GetRandomizedMC on the same line? This is quite important to my application because I construct numbered displays from stored data which doesn't (can't) contain the numbering.

Thanks in advance for any help you can provide.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

On of possible solutions - saving source to TMemoryStream as RVF, then using AppendRVFFromStream with -1 in ParaNo parameter.

When saving, temporary exclude rvfoSaveTextStyles and rvfoSaveParaStyles from RVFOptions (cells do not support them). Since you use AppendFrom, I guess both the source and the target richviews are connected to the same RVStyle, so there must not be problem with mismatched styles.
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

Thanks for the quick support for this and the 'want tabs' question - both answers 'did the job' :D
Post Reply