Function at same as "Memo.Text" ?

General TRichView support forum. Please post your questions here
Post Reply
RichEnjoyer
Posts: 14
Joined: Fri Jan 20, 2006 11:05 am
Location: Germany

Function at same as "Memo.Text" ?

Post by RichEnjoyer »

Hallo,

how become all chars in one string?

best wishes, Frank
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

See the functions in RVGetText.pas.
Or, if you need one-to-one correspondence between the document and the resulting string, functions from RVLinear.pas
Yernar Shambayev
Posts: 57
Joined: Wed Aug 31, 2005 6:46 pm

Re: Function at same as "Memo.Text" ?

Post by Yernar Shambayev »

RichEnjoyer wrote:Hallo,

how become all chars in one string?

best wishes, Frank
function AllText(MyRV: TCustomRichView): string;
begin
MyRV.SelectAll;
Result := Trim(MyRV.GetSelText);
end;
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yernar, this procedure actually returns all the text (not necessary to Trim it), but :
1) it modifies RichView state (selects all document)
2) it requires document to be formatted (this is a disadvantage if you want load documents from files/database and quickly extract text from them)
Post Reply