Description
Searches the current text for a string.
Syntax
Text.Find (str1, str2) |
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
Return value
Error code
Examples
Use custom scripts to find special characters, tags and formatting. For special character codes, see the table on the bottom of this topic.
•To find in text all tags such as >head 20<, >headline<, use the following script:
Text.Find (chr(1) & "head", "G+S+W-U+B-")
Special character |
Code |
Const |
Tag bracket > |
chr(1) |
|
Tag bracket < |
chr(2) |
|
Start table ¦ |
chr(4) |
StartTab |
Table column |
chr(9) |
Tab |
Last tab row |
chr(8) |
LastStartTab |
Line break ¬ |
chr(5) |
Ret |
Paragraph break |
chr(6) |
HardRet |
Bell @ |
chr(7) |
Bell |
Remarks
The above codes apply only on Find and FindReplace methods. If you're using the standard Instr function to find content in a string, populated by Text.TedGetTxt method, the codes are different: see GetTxt Method.
Context
Text designer commands
See also
FindNext, FindReplace, FindDlg, FindReplaceDlg