I suggest you ...

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:-

77 votes
Sign in
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Nicholas De La Haye shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
Sign in with: facebook google
Signed in as (Sign out)
  • Dr. Dennis Neder commented  ·   ·  Flag as inappropriate

    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.

    For example:

    'example PRE-INCREMENTS icounter before use
    'thus, the first iteration is array-element 0, second is 1, etc.
    Dim iCounter As Integer = -1
    While sdr.Read()
    ary(++iCounter) = sdr(iCounter)
    End While

    Other examples:

    ' 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

Feedback and Knowledge Base