I changed some c # code on vb.net and converter. Tilik.com started it:
i--; In this:
System.Math.Max (System.Threading.Interlocked.Decrement (i), i + 1)is to return the current value of
The current terminology for C # in code> i -
i(i.e., the value is before the decrease) and then a <<> codeSo, we need to convert him to VB. We can not use
i - = 1because it does not return the current value ofibefore it decreases. Therefore, we need an operation that reducesi, but the value oficomes back to the value, like something:Function DoPostDecrement (I as integer) ByRef integer as I - = 1 return i + 1 termination functionBut to write a method to perform this To avoid being suggested to use the following:
System.Math.Max (someValueThatIsEqualToiMinusOne, someValueThatIsEqualtoiBeforeTheDecrement)but V B.NET will not use you to replace
me - = 1ori = i - 1in thesome valueIsquateTimionOn. However,System.Threading.Interlocked.Decrement (i)is valid and the value ofi-1is equal. Once you have done that, because the parameter is correct, thesomeValueThatIsEqualtoiBeforeTheDecrementis left to be evaluated toi + 1(execute on that point decreasingi + 1is the decreasing value.Note that the above method is
DoPostDecrementandSystem.Math.Max, System. Threading.Interlocked.Decrementcreation can be different semantically in a multi-reference context.
No comments:
Post a Comment