| Your code changes the value in the dictionary item itself. Not just
| the value contained in the dictionary item (which is the array). i.e. it
| basically changes the whole array.
No. It just gets a pointer to the array variable first,
rather than trying to do it in one step. The problem
seems to be that the array is not part of a dic object
model, so you can't reference it that way.
| Even though that workaround works, it'll cause performace decrease for
| arrays because the array needs to be copied two times. But that can't be
| helped, since it seems to be the only workaround.
It will probably slow things down. If you're doing something
big I wonder if a dictionary class could be better. I use them in
VB6. But everything's slow in VBS due to the constant data
I do a similar thing to unpack MSI files and it works reasonably
well. I process all the data into an object model by using numerous
dictionaries to store it.
I assume you know you can access the items as a Keys array.
But of course that, not typically useful unless you just want to
walk the array. It defeats the purpose of accessing one item directly
by its keyy name.
| My guess for problem, is due to the fact that the array or any value is
| stored in a COM object instead of the script engine itself, because COM
| properties can only have either `propget`, `propput`, and `propputref`.
| There is no `propgetref`. And Dictionary COM doesn't expose any method
| can return the reference of an item's content. The script engine can not
| know the direct reference of a property content because the property
| is managed by an external library.
Sounds right. In other words, there's no object model.
With something like DOM you can have document.DivA(3).borderstyle,
but that's because the whole thing is an object model. The
variable pointer here is to the dictionary. Dictionary members
are not variables until you reference them. I hadn't thought of
it that way, but it makes sense.