English

FAQ: Why does every item in an array have the same value as the last item?

Question

Why does every item in an array have the same value as the last item?

Answer

.NET languages are weakly declared, meaning all variables do not have to be declared explicitly. This can cause all items in an array to have the same last value.

To solve this problem, declare with Dim a separate object for every item in an array.