Accessing Element (0,0) in Zero-Bound Arrays
Posted on 2013-02-02
I never really liked to work with the zero part of zero bound arrays, but now that an array I am working with (declared using Dim x(100,100) As Object) stores data in x(0,0), x(0,1) etc, I need to read these elements.
When looking inside an array at run-time using QuickWatch, there is a valid e.g. string value in the (0,0) element, that is, this element is not "Nothing" or Null, etc. However, I can't access the (0,0) element using for example msgbox(x(0,0)) without throwing an exception that the index is wrong. For some reason it needs x(1,1) --> and this shows the x(0,0) element value.
The question is, if I have always been only reading the (1,1) element and higher in previous work to truly access the (1,1) element, why do I need to use (1,1) this time to see the contents of (0,0)? Note, it is declared as Object, rather than Double, or Single, etc. so is this a reason?