Increment (++) and Decrement (--) Operators in VB.net
The whole purpose of the .net framework is the methods should be common to all languages. In the case of System.Int32 you are not allowed to use the follow in VB:-
TestValue++ or ++TestValue
So if I had an array the following is impossible in VB but possible in C#:-
TestValue = TestArray(Index++)
So instead I have to write the following:-
Index += 1
TestValue = TestArray(Index)
Please enhance VB to include Increment (++) and Decrement (--) Operators in VB.net as per the MSDN info on c# below:-
Thanks for the suggestion. We’re moving language design to GitHub. Please feel free to refile at https://github.com/dotnet/vblang if this suggestion is still something you advocate.
Dr. Dennis Neder commented
I'd like to add one additional feature element to this excellent point.
It would be good to have the ability to increment/decrement the array pointer BEFORE OR AFTER being used in the array.
'example PRE-INCREMENTS icounter before use
'thus, the first iteration is array-element 0, second is 1, etc.
Dim iCounter As Integer = -1
ary(++iCounter) = sdr(iCounter)
' this example POST-DECREMENTS iCounter after use
' thus, here iCounter = 10 upon first use and becomes 9 after the array element is loaded
Dim iCounter As Integer = 10
ary(iCounter--) = value