Description
Searches the current text for a string.
Available in Ted and in Fred.
Syntax
object.Find (str1, str2, bNewSearch) |
object
Required. Object name. Returned by Ted.GetActiveArticle.
str1
text string to be searched
str2
options for the retrieval:
U[+/-] = activates/deactivates case sensitivity
G[+/-] = activates/deactivates retrieval in entire text
B[+/-] = activates/deactivates retrieval backwards
S[+/-] = activates/deactivates retrieval inside selection
T[+/-] = activates/deactivates jump of the cursor on found element
W[+/-] = activates/deactivates whole word match
bNewSearch
Required. Boolean parameter that indicates if starting a new search in the article (true) or continue the previous one (false).
Return value
Error code
Example
Public Sub ArtFindDlg()
If Fred.HasActiveArticle Then
Dim dlg As New FindReplaceDlg(TedApp.GetSearchDescPtr(), False, True)
If dlg.ShowDialog() Then
ActiveArticle.DoFindRepl(False, False)
End If
End If
End Sub
Remarks
In Fred, acts only on the text elements which are linked to the current page. If a text element of an article is linked to some other page. e.g. jump page, or it's not linked to any page, this function ignores it.
Example
Ted.GetActiveArticle.Find "TeraDP", "B-", false
Context
Article object
See also
DoFindRepl, FindNext, FindReplace