Variant Arrays

Arrays in VBScript follow the standard Automation variant object. That is, if you create a variant array used in Automation, the array elements can be directly accessed via VBScript. JScript uses an internal representation for arrays and therefore will not be able to access variant arrays - a serious limitation, since most Automation objects which deal in arrays represent them as variant arrays.

To avoid this limitation for the arrays represented in a DataValue object, the Value and IValue properties of the DataValue object are overloaded to allow a column and row index to be supplied. This means that scripting languages that do not support variant arrays natively can still access data values through the use of indexing.

Internally created JScript arrays (that is, x = new Array()) cannot be assigned to the methods or properties of Automation objects which expect variant arrays, since JScript represents arrays in a different format. Therefore the following sequence of statements is not valid in JScript:

var jsArray = new Array(5);

Outputs(0).Value = jsArray;