... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2005-01-04

JScript

JScript has no direct way of creating Variant arrays (aka SafeArrays or VBArrays).  However, here is a hack to create one:

function makeVBArray(elements)
{
    var dictionary = new ActiveXObject("Scripting.Dictionary");
    for (var i = 0; i < elements.length; ++i) {
        dictionary.add(elements[i], "");
    }
    return dictionary.Keys();
}

Blog Archive