Watching an array size

C

cmdolcet69

I found something curious today when i add my arraylist to my watch
window i notice that my array size with looping was 501 however it
only displayed 200. Why is that?
Dim i As Integer
Dim arr As New ArrayList

For i = 0 To 500
arr.Add(i)
Next
 
G

Guest

I found something curious today when i add my arraylist to my watch
window i notice that my array size with looping was 501 however it
only displayed 200. Why is that?
Dim i As Integer
Dim arr As New ArrayList

For i = 0 To 500
arr.Add(i)
Next

Array Lists are 0 indexed (0... 500 = 501 elements)

So to add 500 elements, it should be 500 - 1
 
A

Armin Zingler

cmdolcet69 said:
I found something curious today when i add my arraylist to my watch
window i notice that my array size with looping was 501 however it
only displayed 200. Why is that?
Dim i As Integer
Dim arr As New ArrayList

For i = 0 To 500
arr.Add(i)
Next

There must be a limit somewhere. Otherwise it can take very long to display
the window, e.g. if you have 100,000 items in the array.

In VB 2005, there is no such limit AFAIS. (probably differently rendered)


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top