I need to do a filter and I think the better way is to make an IF statement with a string expression made dinamically by the user. I want the user construct his own filter (by comboboxes) and sent it through a string variable to one and single IF statement.
If is not clear, I want to do something like this:
e1 = “var1==value1”;
e2 = “var3==value2”;
…
eN = “varN==valueN”;
operator1 = “&&”;
operator2 = “||”;
…
operatorN = “&&”;
par1 = “(”;
par2 = “)”;
…
parN = “)”;
//Remember! e1…eN, operator1…operatorN and par1…parN are transmitted by the user
expression = e1 + operator1 + par1 + e2 + operator2 + e3 + par2 … //and so on…;
if(eval(expression))
{ … }
but is not working in such simple way :diss::diss:
Please, help me ! Any ideea ?