Okay... I THINK I got it.
It has to do with what sorts of arrays TestComplete works with versus the native JScript array object type. You kind of have to switch things back and forth. From the help topic
http://smartbear.com/support/viewarticle/13265/#JS, I adapted the code as such... this works...Essentially, I create a native JScript array... convert it to a VBArray, then convert it back to a JScript array
function ConvertJScriptArray(JScriptArray)
{
// Uses the Dictionary object to convert a JScript array
var objDict = Sys.OleObject("Scripting.Dictionary");
objDict.RemoveAll();
for (var i in JScriptArray)
objDict.Add(i, JScriptArray);
return objDict.Items();
}
function blah()
{
var MyArray = new Array();
for (var i = 0; i <10;i++)
{
MyArray=i;
}
MyArray = ConvertJScriptArray(MyArray)
Project.Variables.MyTable.Item("MyCol", 0) = MyArray;
var foo = new VBArray(Project.Variables.VariableByName("MyTable").Item("MyCol", 0));
foo = foo.toArray();
foo[10] = "yada"
Log.Message(foo[10]);
Log.Message(foo[1]);
}