EmEditor Home - EmEditor Help - EmEditor Macro Reference - Selection Object

Find Method

Searches for the specified string.

[JavaScript]

nFound = document.selection.Find( strFind, nFlags );

[VBScript]

nFound = document.selection.Find( strFind, nFlags )

Parameters

strFind

Specifies a string to search for.

nFlags

Specifies a combination of the following values:

eeFindAround Moves to the start of the document when reaches the end of the document.
eeFindBookmark Sets bookmarks on lines where the string is matched.
eeFindCount Counts the occurrences of the matched string.
eeFindNext Searches downward from the cursor position.
eeFindPrevious Searches upward from the cursor position.
eeFindReplaceCase Matches cases.
eeFindReplaceEscSeq Uses escape sequences. Cannot be combined with eeFindReplaceRegExp.
eeFindReplaceOnlyWord Matches only whole words.
eeFindReplaceOpenDoc Searches all open documents in the same frame window.
eeFindReplaceQuiet Does not display a message on the status bar if no string is found.
eeFindReplaceRegExp Uses a regular expression for the searched string. Cannot be combined with eeFindReplaceEscSeq.
eeFindSaveHistory Saves the searched string for repeated search.
eeFindSelectAll Selects all matched strings.

Return Values

Returns 1 if the searched string is found, or 0 if not found. However, if the eeFindCount flag is specified, the return value is the number of the occurrences of the matched string in the document. Nevertheless, if the searched string is not found from the cursor position toward the specified direction, the return value is 0 even it the matched string is found in the rest of the document.

Version

Supported in EmEditor Professional Version 4.00 or later.

Copyright 2003-2014 by Emurasoft, Inc.