Page 1 of 1

GetItemTextR

Posted: Thu Aug 09, 2018 11:13 am
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;

Re: GetItemTextR

Posted: Thu Aug 09, 2018 12:57 pm
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?

Re: GetItemTextR

Posted: Fri Aug 10, 2018 9:32 am
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

Re: GetItemTextR

Posted: Fri Aug 10, 2018 8:39 pm
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

Re: GetItemTextR

Posted: Sat Aug 11, 2018 11:06 am
by jota
Hi, thank you so much for everything.