Problem accessing non-sequentially indexed array elements in a Variant
Posted on 2000-03-21
I have a control array with non-sequential indexes (i.e 3, 7, 9, 15) which is completely valid in VB (and often useful). It is passed to a function as a Variant (apparently the only way to pass it).
As a Variant inside the function I can't figure out how to loop through the elements.
With a plain old array you can use LBound and UBound and ignore the invalid index errors that occur along the way with an On Error statement (perhaps there is a better way). But with the Variant LBound and UBound don't work.