Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : SEARCH( ) method
 

SEARCH( ) method

Searches for a specified string in an editor widget starting from the current text cursor position. For graphical interfaces only, the string is highlighted when found.
Return type: LOGICAL
Applies to: EDITOR widget

Syntax

SEARCH ( string , flag )
string
The character-string expression for which to search.
Note: You cannot specify wildcard characters in the search string.
flag
An integer expression that specifies the type of search to be performed.
The flag expression determines what type of search to perform. The following table lists the flag values that correspond to each search type.
Table 106. SEARCH flag values
Type of search
Flag value
FIND-NEXT-OCCURRENCE
1
FIND-PREV-OCCURRENCE
2
FIND-CASE-SENSITIVE
4
FIND-WRAP-AROUND
16
FIND-SELECT
32
For a single search operation, you cannot specify both FIND-NEXT-OCCURRENCE and FIND-PREV-OCCURRENCE. Any other combination of these flags is valid. To do multiple searches, you add the flag values. For example, you can specify FIND-PREV-OCCURRENCE and FIND-WRAP-AROUND by adding their flag values, 2 and 16, to invoke SEARCH(string, 18).
If the operation is successful, the method returns TRUE.