ITabRowSearch.AddCondition

Syntax

AddCondition(Column: Integer; Text: String; CaseSensitive: Boolean WholeWordsOnly: Boolean);

Parameters

Column. The number of the column based on which the search condition is specified.

Text - the text, which should be searched in cells.

CaseSensitive - the parameter defining whether character case should be taken into account during search.

WholeWordsOnly - the parameter which determines, whether the whole word should be searched.

Description

The AddCondition method adds a search condition.

Example

Sub Main;

Var

MB: IMetabase;

Rep: IPrxReport;

Tab: ITabSheet;

RowSearch: ITabRowSearch;

Result: ITabSearchResult;

i: Integer;

Begin

MB := MetabaseClass.Active;

Rep := MB.ItemById("Reg_rep").Bind As IPrxReport;

Tab := Rep.ActiveSheet.Table;

RowSearch := Tab.CreateRowSearch;

RowSearch.AddCondition(0, "2", False, True);

RowSearch.AddCondition(1, "4", False, True);

Result := RowSearch.Execute;

If Result <> Null Then

i:=Result.CurrentRow;

End If;

End Sub Main;

As a result search for a row will be performed, which contains "2" in the first column, and "4" in the second column. If the search is successful, the "i" variable will contain the number of the found row.

See also:

ITabRowSearch