When converting c# to VB.net the operators ++ and -- is converted incorrectly which gives incorrect results then from the original code. Consider the following c# example:- TestValue = TestArray[Index++];

This code uses the original value of say 0 in the variable "Index" and then increments the value afterwards. But converting this code to VB. net does not do this!

After conversion we get the following:-TestValue = TestArray(System.Math.Max(System.Threading.Interlocked.Increment(Index),Index - 1))

The converted code always increments the value first and never uses the initial value of say 0 before it is incremented. You use a the function Max which take the highest value, but your use of Max never uses "Index - 1" as its always less, making it pointless to use the Max function. The proper conversion would be:Index+=1TestValue = TestArray(Index)

Please can you fix this bug?

Problem by Nicholas De La HayeStatus: Not DoneComments: 1Last update: 2016-08-22T15:22:26 by Nicholas De La Haye

This c#: tokenList.Add(kvp.Key, new IndexValue(index++, kvp.Value));converts to this VB:tokenList.Add(kvp.Key, New IndexValue(System.Math.Max(System.Threading.Interlocked.Increment(index),index - 1), kvp.Value))