ChandanD
4 years agoContributor
Add value in Array from FindAllChildren
Hello,
I want to add the values in array from FindAllChildren and then find the Maximum value from array and perform the action on the max value.
But I am unable to enter the value in array and get the max value.
Please help to add the value in array and fetch the values from array.
var AllSelectCID = IBCDesigner.HwndSource_Window.WindowDeviceVersionSelection.TabControlSWVersionSettings.FindAllChildren(Array("ClrClassName","WPFControlOrdinalNo"), Array("CellValuePresenter", "2"), 100)
var max = []
for (var SelectCID of AllSelectCID)
{
Visible_Index = SelectCID.DataContext.VisibleIndex
Log.Message(Visible_Index)
var max = Visible_Index[0]
for (let i = 0; i < Visible_Index.length; ++i) {
if (Visible_Index [i] > max) {
max = Visible_Index [i];
}
}
Log.Message(max);
}
Log.Message("The complete array is"+ max)
Log.Message(max.length)