Forum Discussion

nwuser_testcomp's avatar
nwuser_testcomp
Occasional Contributor
11 years ago

Not able to convert array to array of objects using function ConvertJScriptArray(JScriptArray)

Hi,

 

I am not able to convert my array to array of objects using function 

ConvertJScriptArray(JScriptArray) 

 

Below is the code I copied from help section-

 

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[i]);

return objDict.Items();

 

}

 

when I add watch to objDict.Items(),objDict.items()[0] is undefined

 

I need to convert this array to array of objects as it is being passed in one of the method of .net classes,I have imported using CLR bridge

 

Please help!!

TIA

 

No RepliesBe the first to reply