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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With