Method XbpRtf():find() Foundation
Searches a character string in the text buffer.
Syntax
:find( <cSearchString>, [<nStart>], [<nEnd>], [<nOptions>] ) --> nPos
Parameters
<cSearchString>
A character string to search for in the text buffer.
<nStart>
A numeric value that specifies the character to begin the search with. This parameter is optional. If no value is passed for <nStart>, the search begins at the value contained in instance variable :selStart. Character positions are specified beginning from zero.
<nEnd>
A numeric value that specifies a character position. The search is performed up to the position specified in <nEnd>. This parameter is optional. If no value is passed, the search ends either at the end of the current selection or, if the selection is empty, at the end of the document.
<nOptions>
#define constants from the file XBP.CH can be used for this parameter. They instruct an XbpRtf object on how to search for a string. The following table lists valid constants:
Constants for search options
Constant | Description |
---|---|
XBPRTF_MATCH_WHOLEWORD | Find whole word |
XBPRTF_MATCH_CASE | Match case |
XBPRTF_MATCH_NOHILIGHT | Do not highlight found string |
The constants represent toggles and can be added together. This makes it possible to issue a case-sensitive search for a whole word, for example. If no value is passed for parameter <nOptions>, the search is performed without case-sensitivity, with all patterns being matched. If a match is found, it is highlighted using the highlight color.
Return
This method a numeric value that specifies the position of the first character found. If no match is found, :find() returns -1.
Description
The method searches for a string in the text buffer of the XbpRtf object.
Feedback
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.