rvico TRichView Reference | Overview

Searching and Replacing in RichView and RichViewEdit

Top  Previous  Next

The following main functions for text searching are available:

function TRichView.SearchText(s: String; SrchOptions: TRVSearchOptions): Boolean;

function TRichViewEdit.SearchText(s: String; SrchOptions: TRVESearchOptions): Boolean;

These methods search for the substring s. If found, they select it an make it visible (scroll the window to it).

unicode Unicode note: ANSI and Unicode versions of these methods are available (SearchTextA and SearchTextW).

The methods of TRichView start searching from the current selection (if exists) or from the first (or the last, when searching up) visible item. If rvsroFromStart is included in SrchOptions, the methods start searching from the beginning (or the end, when searching up) of the document.

The methods of TRichViewEdit start searching from the caret position.

All the methods support the following options:

searching up or down;

case sensitive/insensitive searching;

searching for the whole words;

allowing matching in a single text item or in multiple items.

s may contain a tab character (#9). However, it makes sense only if the option for matching in multiple items is set.

 

The unit RVMisc.pas contains the functions to convert options of search dialogs:

function GetRVSearchOptions(fo: TFindOptions): TRVSearchOptions;

function GetRVESearchOptions(fo: TFindOptions):TRVESearchOptions;

It's easy to implement replacing of text in editor. SearchText selects the old substring, InsertText replaces the selected string with the new one.


TRichView © trichview.com