Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

One line initialization of multiple variables

$
0
0
Is there any reason why MS did allow for a one liner to initialize multiple variables. Take this for example:
Code:

Dim a, b, c As Integer
This is great if I want all the integers to be 0, but if I want them to be a different value then I'm forced to set those variables individually. Grant it, I'm able to use the : character to set all those variables on 1 line, but I'm still forced to individually set those variables. What I'm wondering is why they don't allow for something like this:
Code:

Dim a, b, c As Integer = 5
This is more of a discussion rather than a question, to see if maybe y'all have some opinions on why they didn't allow for that.

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>