[2005] Continued from previous thread....array or arrayList
Continuing from a previous thread (http://www.vbforums.com/showthread.php?&t=429114) i came across a little problem. When copying the elements of the previous array into the new one i noticed that its copying all the elements that have nothing in them, so instead of adding, for example, one element across each time, its copying 2 and i have a load of elements in my new array that have nothing in them. So how can i change the code in posted in the previous thread so that only the element that contains something is copied?
Re: [2005] Continued from previous thread....array or arrayList
Huh? How is it copying two elements at a time? I think you need to give an example of what each array contains before the operation and then what the resized array contain afterwards, and show EXACTLY what code you're using. I used this code:
VB Code:
Dim existingArray As String() = {"String1", "String2", "String3"}
Dim arrayToAdd As String() = {"String4", "String5", "String6"}
Dim originalLength As Integer = existingArray.Length
Re: [2005] Continued from previous thread....array or arrayList
I think its because i am doing this all on a separate thread which is controlled by a timer, so everytime the timer ticks a new XML file is downloaded and the information is stored in arr_Results.
Here's the code i have anyway just for reference:
VB Code:
Private Sub tmr_Thread_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr_Thread.Tick
threadTick = True
Dim thread1 As New Thread(New ThreadStart(AddressOf Me.getResults))
and the when the timer has ticked twice the content of arr_storeResults are:
arr_storeResults(0) = nothing
arr_storeResults(1) = result
arr_storeResults(2) = nothing
arr_storeResults(3) = result
arr_storeResults(4) = nothing etc...