Converting VB to C# - error "invalid SimpleNonInvocationExpression"?

170 Views Asked by At

I am using SharpDevelop 4.4 to convert some VB.NET to C# code. It produced the following error which I don't understand:

D:\path\ClassName.vb is not converted:
Parser found 1 error(s)
-- line 143 col 22: invalid SimpleNonInvocationExpression

The line of code it complains about is:

result = -10 ^ -5 * x ^ 2 + 0.0004 * x + 8.3463

where x is a Single. Column 22 is the leading minus sign.

The VB code compiles fine... what does this error message mean?


Searching on "SimpleNonInvocationExpression" the only things I can find are source code to SharpDevelop or websites which are not in English that I can't read.


EDIT: As a workaround I commented the line out, converted the code, and then manually translated the line. This was a fine workaround for a single line, but would be a disaster for many.

The end result (as suggested by @topshot) was:

result = -Math.Pow(10, -5) * Math.Pow(x, 2) + 0.0004 * x + 8.3463;
0

There are 0 best solutions below

Related Questions in VB.NET-TO-C#