Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Document Object > Methods

EmEditor Macro Reference: Filter Method

Scroll Prev Top Next More
EmEditor Home - EmEditor Help - EmEditor Macro Reference - Document Object

Filter Method

Filters the document with the specified string and settings.

[JavaScript]

nCount = document.Filter( strFilter, iColumn, flags[, xBegin[, xEnd]] );

[VBScript]

nCount = document.Filter( strFilter, iColumn, flags[, xBegin[, xEnd]] )

Parameters

strFilter

Specifies a string to search for.

iColumn

Specifies the one-based index of the column of the text you want to search, 0 if you want to search for whole lines, or -1 if you want to specify the beginning and end of the text in characters as xBegin and xEnd.

flags

Specifies a combination of the following values.

eeFindContinue

Specifies the Filter method called next time should not clear the filter. This filter is not applifed immediately after this Filter method is called. This flag is used when you want to create multiple levels of the filter. It is similar to the eeFindKeepPrevious flag, but since the actual filter is not applifed each time the Filter method is called, this method works faster if there are multiple filter levels.

eeFindKeepPrevious

Specifies the Filter method should not clear the existing filter before applying the new filter. This flag is used when you want to create multiple levels of the filter.

eeFindLogicalOr

Specifies a logical disjunction (logical OR) to the previous level in case of multiple levels of the filter.

eeFindNegative

Shows the Filter toolbar and excludes the lines that match the specified string.

eeFindRemoveLast

Removes the last added filter level.

eeFindReplaceCase

Matches cases.

eeFindReplaceEscSeq

Uses escape sequences. Cannot be combined with eeFindReplaceRegExp.

eeFindReplaceOnlyWord

Matches only whole words.

eeFindReplaceRegExp

Uses a regular expression for the searched string. Cannot be combined with eeFindReplaceEscSeq.

xBegin

Specifies the index of beginning of the column (in logical characters) of the text you want to search, or 0 if you want to count the last portion of the text and specify as xEnd. The iColumn must be -1 to enable this field.

xEnd

Specifies the index of end of the column (in logical characters) of the text you want to search, or 0 if you want to search all the rest of the text. The iColumn must be -1 to enable this field.

Return Values

The return value is the number of the lines that match the specified string. If the specified string is an empty string, the return value is -1. If eeFindContinue is specified, the return value is 0.

Version

Supported on EmEditor Professional Version 14.7 or later.

Copyright © 2003-2016 by Emurasoft, Inc.