comdata(0, 0) = "5"
comdata(0, 1) = "3"
comdata(0, 2) = "10"
comdata(0, 3) = Nothing
comdata(1, 0) = "1"
comdata(1, 1) = "7"
comdata(1, 2) = "14"
comdata(1, 3) = Nothing
comdata(2, 0) = "5"
comdata(2, 1) = "8"
comdata(2, 2) = "14"
comdata(2, 3) = Nothing
I have an array that looks like above. I would like to make something like below. The idea is when there are same value on the array comdata(,), for example there are two value 5, on the comdata(0, 0) and comdata(2, 0). I would like to set value on the comdata(2, 0).
choose(0,0) = True
choose(0,1) = True
choose(0,2) = True
choose(0,3) = False
choose(1,0) = True
choose(1,1) = True
choose(1,2) = True
choose(1,3) = False
choose(2,0) = False
choose(2,1) = True
choose(2,2) = False
choose(2,3) = False
I have try it with the code below, unfortunately when the value of i = 2, it cannot check the comdata(0, 0), comdata(0, 1), comdata(0, 2), comdata(0, 3). So the value of choose(0, 0), choose(0, 1), choose(0, 2) will be set to true.
For i = 0 To 2
For j = 0 To 2
If comdata(i, j) <> Nothing Then
If i = 0 Then
choose(i, j) = True
Else
For k = 0 To 2
If comdata(i, j) = comdata(i - 1, k) Then
choose(i, j) = False
Else
choose(i, j) = True
End If
Next
End If
End If
Next
Next
chooseis set toFalseon a non-empty instance? For example, ifcomdata(0,0)andcomdata(1,2)are both"5", shouldchoose(1,2)be set toFalse?