GetItemTextR

General TRichView support forum. Please post your questions here
Post Reply
jota
Posts: 48
Joined: Fri Sep 16, 2011 10:56 am

GetItemTextR

Post by jota »

Hi

The following function produces an error when compiling with trichview 17, because the "GetItemTextR" method does not exist

Who can give me an alternative that works. Thanks in advance

Code: Select all

function GetItemText2Mod(RVData: TCustomRVData; ItemNo: Integer): TRVAnsiString;
begin
  if RVData.GetItemStyle(ItemNo)>=0 then
    Result := RVData.GetItemTextA(ItemNo)
  else if RVData.GetItem(ItemNo).GetBoolValue(rvbpAlwaysInText) then
    Result := RVData.GetItem(ItemNo).AsText(0, RVData, RVData.GetItemTextR(ItemNo), '', True, False, 0)
  else
    Result := '';
end;
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: GetItemTextR

Post by Sergey Tkachenko »

It was removed because it makes no sense now, because all text is stored as Unicode.
Also, the parameters of item.AsText were changed.

What's the purpose of this function? How do you use its result?
jota
Posts: 48
Joined: Fri Sep 16, 2011 10:56 am

Re: GetItemTextR

Post by jota »

I compose a text string, concatenating each line of a 'tdbrichview', stored in rvf format, in a blob field in the database.
Some lines contain information such as the following.
'Name'#$D#$A'Discount'#$D#$A'Others'#$D#$A'10.03.2011 – 11.03.2011'#$D#$A

#9
With this code in function 'GetItemText2Mod' I try to include in the string, the text that contains the previous example lines.

Code: Select all

Result := RVData.GetItem(ItemNo).AsText(0, RVData, RVData.GetItemTextR(ItemNo), '', True, False, 0)
Is this wrong?, there is an alternative?

Thank you for your attention
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: GetItemTextR

Post by Sergey Tkachenko »

Do you want to store a text representation of TRichView in a separate field?
In this case you can use functions from RVGetText.pas (or, if you need Unicode text, from RVGetTextW.pas).

If you need this text to implement a full text search, it's better to use RVGetTextRange from RVLinear.pas instead
jota
Posts: 48
Joined: Fri Sep 16, 2011 10:56 am

Re: GetItemTextR

Post by jota »

Hi, thank you so much for everything.
Post Reply