Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a variant array have 0 elements?

The normal dynamic array supports empty (= nil, Length() = 0).

The variant array however does not seem to support this.

I pass my data in variant array (because of OLE/COM), and I get an error when the user defines 0 elements...

I can use varEmpty instead of a 0 length array, but these data arrays are flexible changed (add item, remove item, etc.).

How I can I pass empty arrays in a Variant, or do I need to use other way?

like image 672
durumdara Avatar asked Nov 03 '11 08:11

durumdara


1 Answers

varEmpty is the correct way to handle this. Of course, the code on the other side of the COM interface may not like empty arrays, but that all depends on the particular contract you have with that interface.

like image 177
David Heffernan Avatar answered Oct 20 '22 08:10

David Heffernan