tags:

views:

86

answers:

1

So I am quite confused. I have a public string() array defined, and each time a timer_tick event gets triggered, I loop through the array and visit web pages contained in the array.

for i = 0 to UrlList.Count - 1
  ' Do stuff
  WebBrowser.Navigate(urllist(i))
   While WeBbrowser.ReadyState <> WebBrowserReadyState.Complete
       Application.DoEvents() 
   end while
next

redim urllist(0) ' I have tried w/ & w/out preserve
urllist = nothing
array.resize(urllist,0)

I just want an empty array w/ node count of zero. (essentially eliminating the entire array) I have another process that fills the array. Thanks.

+1  A: 

I suggest using a list, not an array. You could use list.Clear() to empty it, and use For Each to iterate over it. This array functionality is from ancient days pre .NET, when VB had no facilities in the language for lists or other fancy things.

John Saunders
Thank you. It has been a while since I got into .Net (unfortunately my original training from 20 years ago was all about arrays). I will convert it to a list. Thanks again.
Chrispix