Page 1 of 1

richedit.text

Posted: Fri Jan 19, 2007 1:52 pm
by erikvdw
How can I get the full text of the richedit?
Is there something like memo.text ?

Posted: Fri Jan 19, 2007 2:28 pm
by Sergey Tkachenko
Unit RVGetText contains the following functions:

Code: Select all

// Returns text of line with caret
function GetCurrentLineText(rve: TCustomRichViewEdit): String;

// Returns visible text (may be, with a line before and after)
function GetVisibleText(rv: TCustomRichView): String;

// Returns all text
function GetAllText(rv: TCustomRichView): String;

// Returns all text in RVData
function GetRVDataText(RVData: TCustomRVData): String;

// Returns text of paragraph section with caret
// (paragraph section is a part of document limited either by
// paragraph breaks or by new line breaks (added with Shift+Enter)
function GetCurrentParaSectionText(rve: TCustomRichViewEdit): String;

// Returns text of paragraph with caret
function GetCurrentParaText(rve: TCustomRichViewEdit): String;

// Returns character to the left of caret.
// If caret is at the beginning of line, - to the right.
// If no character, returns empty string
function GetCurrentChar(rve: TCustomRichViewEdit): String;

// Returns the current word
function GetCurrentWord(rve: TCustomRichViewEdit): String;
Use GetAllText.

Unit RVGetTextW contains functions wih the same names, returning WideString

Thanks

Posted: Fri Jan 19, 2007 2:38 pm
by erikvdw
Thanks

Posted: Fri Jan 19, 2007 4:03 pm
by j&b
You have one forgotten: GetSelText

memo.format; memo.selectAll;
s:=memo.GetSelText;
ShowMessage(s);