Forum Discussion
tristaanogre
7 years agoEsteemed Contributor
The point of any dictionary is to be able to have a means, by using a key, to return a value. So... that's what we have. Debugging and reporting on how the dictionary is constructed is simply a matter of development process.
theultimate
7 years agoNew Contributor
Thanks a lot for your answers.
I solved my problem, i will post my code below, maybe will help someone.
var wndConspanAnalysisGrid = Aliases.LEAPBridgeConcrete.wndConspan.MDIClient.wndMain.pageMain.pageAnalysis.Custom1;
function TestCreateDictionary()
{
var arrList = getActiveXObject("Scripting.Dictionary");
for (let i = 1; i <= wndConspanAnalysisGrid.wRowCount; i++)
{
var arrListColumns = getActiveXObject("Scripting.Dictionary");
//Sub keys
for (let j = 1; j <= wndConspanAnalysisGrid.wColumnCount; j++)
{
arrListColumns.Add(GetCellText(0, j), GetCellText(i, j));
}
//Principal keys
arrList.Add(GetCellText(i, 0), arrListColumns);
}
/*var safeArray = (arrList.Keys().toArray())
for (let i in safeArray) {
Log.Message("Key is: " + safeArray[i]);
var lineD = arrList.Item(safeArray[i]);
var line = lineD.Keys().toArray();
for (let k in line)
Log.Message("Key is: " + line[k] + ", value is: " + lineD.Item(line[k]))
}*/
var value = SearchValue(arrList, "2", "Location(m)");
Log.Message(value);
//return arrList;
}
function SearchValue(arrList, lineKey, columnKey)
{
var line = arrList.Item(lineKey);
return line.Item(columnKey);
}
function GetCellText(i, j)
{
return wndConspanAnalysisGrid.GetItemText(i, j).m_pszData;
}