Search code examples
javascriptarraysvbscriptassociative

VBScript Anonymous Associative Arrays? (like in Javascript)


Those of you proficient in Javascript and PHP know how to use the Object constructor to reference basically what amounts to an anonymous associative array like this:

myFunction({
    "param1" : "value1",
    "param2" : "value2"
});

The benefit is not having to name each parameter of your target function and being able to set defaults. Does anyone know how to build statements similarly in VBScript? I was looking into the Dictionary class, but I don't think I'll have a firm grasp on how to use that to my advantage here until I see an example.

Thanks,


Solution

  • The Dictionary object is exactly what you're looking for. I've used it successfully for multi-language skinning of sites. It's not difficult to use.

    see: http://www.devguru.com/technologies/vbscript/13992.asp