But it's not perfect. Sometimes it makes mistakes.
I had this line of code in C/AL
IF AVSetup."Sub Award Dimension No." - 1 IN [1..8] THEN BEGINWhich auto-translated to this in C#:
if(aVSetup.Target.Oops. The order of operations got mixed up. The C/AL code subtracts one, then sees if the value is between 1 and 8. The C# sees if 1 is between 1 and 8 (getting a boolean value) and then tries to subtract the boolean value from the number. C# then gives this error:
GetFieldValueSafe(90, NavType.Integer).ToInt32()-(1 >= 1 && 1 <= 8))
Operator '-' cannot be applied to operands of type 'int' and 'bool'Thankfully, the solution for this is simple. All you have to do is use extra parentheses to explicitly set the Order of Operations.
IF ((AVSetup."Sub Award Dimension No." - 1) IN [1..8]) THEN BEGIN