Is there a way to give a value to multiple variables (integers in this case), instead of all at once?
For instance, I have Dim aceVal, twoVal, threeVal, fourVa
You can try like this:
Dim aceVal, twoVal,fourVal,sevenVal, eightVal, nineVal, tenVal As Integer
Dim threeVal As Integer =-1,fiveVal=-1,sixVal=-1
alternatively follow this post: http://www.informit.com/library/content.aspx?b=Net_2003_21days&seqNum=95
You can declare and asign the value using the constructor:
Dim str1, str2, str3, str4 As New String("asdf")
Dim int1, int2, int3, int4 As New Integer
you can put it in List and use For Each method here is the code
Dim aceVal, twoVal, threeVal, fourVal, fiveVal, sixVal, sevenVal, eightVal, nineVal, tenVal As Integer
Dim var As New List(Of Integer) From {threeVal, fiveVal, sixVal} 'you can add more variable here
For Each n As Integer In var
n = -1
Next