What I'm trying to do is re-write an array into a list box, changing only a specific index in the array. I know how I would do this in Java, using a for loop and an if statement to change the specific index, but I can't seem to get it to work in Visual Basic
For example, the array is:
I want to re-write the array to:
When a user clicks a button with a specific index.
It doesn't write "Not done" anywhere, it re-writes the array as all "Done"
For example, the array is:
Code:
Done
Done
Done
Code:
Done
Not done
Done
Code:
For l3 = 0 To (SeatBooked.Length - 1) 're-writing the array
If l3 = aList.SelectedIndex Then 'if the loop = their selected index
SeatBooked(l3) = "Not done" 'that's not done
Else
SeatBooked(l3) = "Done" 'others done
End If
Next
nList.Items.Clear()
For al = 0 To SeatBooked.Length - 1
nList.Items.Add(SeatBooked(SeatBooked.Length - 1))
Next
p = p + 1
Return
End While
Next
Next