Find a row in the table using the advanced filter.

The filter is taken from the filter table.


The example shows how to find a row in an iTable that has the value "WALL" in the column named "Column1", the value in the column "Column2" contains "3", the column "Column3" contains "B22" or " В22" (В - either in Russian or English) and in the column "Column 4" a number greater than or equal to 2.


bool stoponfirstnoteq = false;
bool add_sum = false;

int iTableFilter;
object("create", "ts_table", iTableFilter);
ts_table(iTableFilter, "create_structure_for_filter_table");
ts_table(iTableFilter, "add_row_to_filter_table", "(", "ANY", "Column1", "=", "WALL", "", "AND");
ts_table(iTableFilter, "add_row_to_filter_table", "", "ANY", "Column2", "CONTAINS", "3", "", "AND");
ts_table(iTableFilter, "add_row_to_filter_table", "", "ANY", "Column3", "REGEXMACH", ".*[BВ]22.*", "", "AND");
ts_table(iTableFilter, "add_row_to_filter_table", "", "ANY", "Column4", ">=", 2, ")", "");

int ires = ts_table(iTable, "search_extended", iTableFilter);


Here

iTable - table descriptor in which to find the row;

iTableFilter - a table handle that describes the filter requirements;

Returns -1 if the string is not found, or the index of the found string (>=0).