Write the contents of the table to the table element of the dialog using an advanced filter passed as a table.

It is convenient when it is necessary to set filter conditions during program execution.


The example shows how to copy from the iTable table to the tabular dialog element (iListBox) all records from the beginning to the end of the table, taking into account the filter - in the column called "Column1" the value is "WALL", the value in the column "Column2" contains "3", the column "Column 3" contains anywhere "B22" or "B22" (B - either in Russian or in English) and in the column "Column 4" a number greater than or equal to 2.


int startrow = 0;
bool stoponfirstnoteq = false;
int maxrows = -1;

int iTableFilter;
object("create", "ts_table", iTableFilter);
ts_table(iTableFilter, "create_structure_for_filter_table");
ts_table(iTableFilter, "add_row_to_filter_table", "(", "ANY", "Колонка1", "=",              "СТЕНА",  "", "AND");
ts_table(iTableFilter, "add_row_to_filter_table",  "", "ANY", "Колонка2", "CONTAINS",           "3",  "", "AND");
ts_table(iTableFilter, "add_row_to_filter_table",  "", "ANY", "Колонка3", "REGEXMACH", ".*[BВ]22.*",  "", "AND");
ts_table(iTableFilter, "add_row_to_filter_table",  "", "ANY", "Колонка4", ">=",                   2, ")", "");

ts_table(iTable, "add_rows_from_eq_table_by_extended_filter", iListBox, startrow, stoponfirstnoteq, maxrows, iTableFilter);


Here:

iTable - descriptor of the table from which rows will be copied to the table element of the dialog;

int startrow - index of the row from which to start copying;

int maxrows - number of rows (-1 - all rows up to the end of the table);

bool bstoponfirstnoteq - stop at the first non-match of the string with the filter condition.