Page 1 of 1

AppendFrom without causing a new line

Posted: Thu Mar 30, 2006 9:21 pm
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.

Posted: Sat Apr 01, 2006 11:21 am
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.

Posted: Sat Apr 01, 2006 8:27 pm
by DickBryant
Thanks for the quick support for this and the 'want tabs' question - both answers 'did the job' :D