0

Is there a way to differentiate a ParamArray from other types of arrays? Right now I'm using TypeName = "Variant()" and LBound = UBound (only one element) to check, but obviously it doesn't work on variant arrays with a single element.

Community
  • 1
  • 1
Hao Zhang
  • 147
  • 9
  • I don't really get the question. How could this be useful? – Rory Jun 20 '16 at 14:35
  • @Rory I want to be able to delegate a ParamArray through a variable number of functions. Right now, every time I pass it directly from one function to another, it adds another level of nesting - which is understandable. I just wanted to know if it was possible to pass it directly. – Hao Zhang Jun 20 '16 at 15:17
  • A ParamArray is just a Variant array. It only 'exists' in a procedure declaration. You can't pass, or test for, a ParamArray as an explicit type. – Rory Jun 20 '16 at 15:24
  • I see. I guess I should just use a normal array instead. – Hao Zhang Jun 20 '16 at 15:31
  • If the array has dimension 1:1, why to make it array? – Sgdva Jun 20 '16 at 16:01
  • I'm trying to pass a ParamArray directly from one function to another. Doing so would result in the second function receiving a variant array with one element: the ParamArray itself. Every time you delegate the ParamArray through one function like this, it gets nested a level deeper. I'm working on a convoluted workaround at the moment. – Hao Zhang Jun 20 '16 at 16:12
  • Put the previous comment at the beginning of the question. – omegastripes Jun 21 '16 at 03:29

0 Answers0