G
Guest
Hi,
Using VB 2005, I have a function that returns an array of a certain object.
In certain cases the function should return an array with a length of 0.
I've found that this works:
Dim child(0) As Object
Array.Resize(Of Object)(child, 0)
Return child
If I leave out the middle line, it returns an array with a length of 1, the
object in the array being nothing.
I'm interested in knowing why this is the case. Why doesn't "Dim child(0)
as Object" create an array with a length of 0?
Thanks,
Nathan
Using VB 2005, I have a function that returns an array of a certain object.
In certain cases the function should return an array with a length of 0.
I've found that this works:
Dim child(0) As Object
Array.Resize(Of Object)(child, 0)
Return child
If I leave out the middle line, it returns an array with a length of 1, the
object in the array being nothing.
I'm interested in knowing why this is the case. Why doesn't "Dim child(0)
as Object" create an array with a length of 0?
Thanks,
Nathan