Hi,
We are using your library to parse an Excel file. This file uses the "CHOOSE" function in several cells and it is not implemented.
I have implemented this function and I wonder if it is possible to include it in your source code.
```
ce.RegisterFunction("CHOOSE", 2, int.MaxValue, Choose);
...
static object Choose(List<Expression> p)
{
int index = (int)p[0];
if (p.Count > index)
return p[index];
else
return string.Empty;
}
```
Comments: ** Comment from web user: JavierPG **
We are using your library to parse an Excel file. This file uses the "CHOOSE" function in several cells and it is not implemented.
I have implemented this function and I wonder if it is possible to include it in your source code.
```
ce.RegisterFunction("CHOOSE", 2, int.MaxValue, Choose);
...
static object Choose(List<Expression> p)
{
int index = (int)p[0];
if (p.Count > index)
return p[index];
else
return string.Empty;
}
```
Comments: ** Comment from web user: JavierPG **
Sorry,
I forgot to evalute the expression. This is the correct code:
```
ce.RegisterFunction("CHOOSE", 2, int.MaxValue, Choose);
...
static object Choose(List<Expression> p)
{
int index = (int)p[0];
if (p.Count > index)
{
Expression value = p[index];
return value.Evaluate();
}
else
return string.Empty;
}
```