Description


Search for the substring s in the document.



function SearchText (s: String; MatchCase: boolean = False; Down: boolean = True; WholeWord: boolean = False; MultiItem: boolean = True; SmartStart: boolean = False): Boolean

 Parameter

 Description

 s

 Search string.

 MatchCase

 Optional parameter. If True, a character case is taken into account when comparing strings.

 Down

 Optional parameter. If True, the search is performed to the end of the document. If False, it is performed to the top of the document.

 WholeWord

 Optional parameter. If True, the searched string matches only whole words.

 MultiItem

 Optional parameter. If True, the search can match substrings of several text items. If not included, the text is searched in each text item separately. For example, if the document contains the text Hello, the substring 'Hello' can be found only if this option is included, because 'He' and 'llo' belong to different items.

 SmartStart

 Not used.



Example


   if Form1.RichEdit1.SearchText('string') then 
      ShowMessage('Found')
   else 
      ShowMessage('Not found');




   if Form1.RichEdit1.SearchText('string', True) then // case-sensitive search
      ShowMessage('Found')
   else 
      ShowMessage('Not found');