Works on my machine using both JScript and VBscript. Perhaps it's your installation of VB that's to blame. There was an issue of this in v1.0. You might have to reinstall VBscript (not XSI).
What kind of errors are you getting?
Here's what I'm doing:
--------JScript------------------------------
var d = new ActiveXObject( "Scripting.Dictionary" );
d.Add( 0, "Hello" );
d.Add( 1, "GoodBye" );
for ( i = 0; i < d.count; i++ ) {
LogMessage( "D[" + i + "]: " + d(i), siInfo );
}
---------VBscript----------
dim d
set d = CreateObject( "Scripting.Dictionary" )
d.Add 0, "Hello"
d.Add 1, "GoodBye"
for each key in d
LogMessage "D: " + d(key), siInfo
next
if you simply want a variable length array, you don't need a dictionary object (at least not in JScript). JScript arrays are dynamic and can be expanded/contracted at any time.
Here's the same example written using an array instead of a dicitionary object.
--------JScript-----------------------------------
var d = new Array(); // Empty array of variable length;
// var d = new Array( 0, 1, 3 ); // creates an array of 3 elements, 'length' property is '2' as indexing starts at 0.
d[0] = "Hello";
d[1] = "GoodBye";
for ( j = 0; j < d.length; j++ ) {
LogMessage( "D[" + j + "]: " + d[j], siInfo );
}
Hope this helps,
speye