Description
Finds data in a DataWindow control or DataStore, or text in a RichTextEdit control or RichTextEdit DataWindow or DataStore.
You can specify search direction and whether to match whole words and case. Finds the specified text in the control and highlights the text if found.
For syntax for DataWindows and DataStores, see the Find method for DataWindows in the section called “Find” in DataWindow Reference.
Applies to
RichTextEdit controls and DataWindow controls (or DataStore objects) whose content has the RichTextEdit presentation style
Syntax
controlname.Find ( searchtext, forward, insensitive, wholeword, cursor )
Argument |
Description |
---|---|
controlname |
The name of the RichTextEdit, DataWindow control, or DataStore whose contents you want to search. |
searchtext |
A string whose value is the text you want to find. For the RichTextEdit control, searchtext is limited to 99 characters. |
forward |
A boolean value indicating the direction you want to search. Values are:
|
insensitive |
A boolean value indicating the search string and the found text must match case. Values are:
|
wholeword |
A boolean value indicating that the found text must be a whole word. Values are:
|
cursor |
A boolean value indicating where the search begins. Values are:
|
Return value
Integer.
Returns the number of characters found. Find returns 0 if no matching text is found, and returns -1 if the DataWindow's presentation style is not RichTextEdit or an error occurs.
Examples
This example searches the RichTextEdit rte_1 for text the user specifies in the SingleLineEdit sle_search. The search proceeds forward from the cursor position. The search is case insensitive and not limited to whole words:
integer li_charsfound li_charsfound = rte_1.Find(sle_search.Text, & TRUE, TRUE, FALSE, TRUE)
See also