Problems using InOperator

Sep 7, 2010 at 3:00 PM

I'd like to make InOperator expressions and I use the example:

ExpressionContext context = new ExpressionContext();
string a = "100 in (100,200,300)";
try
{
    IGenericExpression<bool> e = context.CompileGeneric<bool>(a);
    IDynamicExpression e2 = context.CompileDynamic(a);
    eval = e.Evaluate();
}
catch (Exception ex)
{
}

It make and exception:

Ciloci.Flee.PerCederberg.Grammatica.Runtime.ParserLogException: Unexpected token ",300" <REAL>; expected one of ")"

I use this other expression and it's all right.

string a = "100 in (100;200;300)"

I don't understand because I use the sintax of the example.

Can someone tell me what's the problem??

Thanks

Sep 10, 2010 at 10:02 AM

You must set the correct culture.

I.e. context.Options.ParseCulture = Globalization.CultureInfo.InvariantCulture