Hello,
I am working on an assignment. It involves entering postal codes (like 1111 AA), sorting them, and showing them. We have to use arrays and listboxes.
So far, I have managed to put the postal codes in one listbox. I put the data in an array by using this:
boxList.Items.CopyTo(Array, 0)
Then I sort them based on the numbers using this:
Dim Low As Integer
Dim High As Integer
Dim Temp As Integer
For Low = LBound(Lijst) To Array.Length - 2
For High = Low + 1 To Array.Length - 1
If Low > High Then
Temp = High
High = Low
Low = Temp
End If
Next High
Next Low
Then, I want to put the sorted array into a second listbox:
For p = 0 To List.Length
boxSorted.Items.Add(List(p))
Next p
I get the following error, and the italic part is marked yellow:
Value can't be null. Parameter name: item
I don't know what it means and how I can solve it. Could anyone help me?
I am working on an assignment. It involves entering postal codes (like 1111 AA), sorting them, and showing them. We have to use arrays and listboxes.
So far, I have managed to put the postal codes in one listbox. I put the data in an array by using this:
boxList.Items.CopyTo(Array, 0)
Then I sort them based on the numbers using this:
Dim Low As Integer
Dim High As Integer
Dim Temp As Integer
For Low = LBound(Lijst) To Array.Length - 2
For High = Low + 1 To Array.Length - 1
If Low > High Then
Temp = High
High = Low
Low = Temp
End If
Next High
Next Low
Then, I want to put the sorted array into a second listbox:
For p = 0 To List.Length
boxSorted.Items.Add(List(p))
Next p
I get the following error, and the italic part is marked yellow:
Value can't be null. Parameter name: item
I don't know what it means and how I can solve it. Could anyone help me?