Hola chicos, estoy intentando mostrar un cuadro de pestaña dentro de un cuadro de pestaña usando un bucle
A continuación se muestra mi código, sin embargo, no me permite usar una matriz, solo se permiten variables.
New Window( "Result", display = Tab Box() );
For( j = 1, j <= N Items( stepname ), j++,
step = Substitute( Char( stepname[j] ), "DataTable(\!"Specname=", "" );
display << Add(
step,
main[j] = Tab Box(
)
);
Según su breve descripción, parece que está intentando mostrar diferentes especificaciones para diferentes pasos. El primer script muestra un método que utiliza matrices para realizar una visualización de pestañas en pestañas.
Names Default to Here(1);
steps= {"A", "B", "C", "D"};
step_aa = Associative Array(steps);
step_aa["A"] = {"1101", "1102", "1103", "1104"};
step_aa["B"] = {"2101", "2102", "2207", "2068", "270X"};
step_aa["C"] = {"37Z0", "3027", "3133"};
step_aa["D"] = {"4001", "4005", "4517"};
main={};
New Window( "Result", display = Tab Box() );
For( j = 1, j <= N Items( stepname ), j++,
display << Add(
steps[j], PanelBox("",
tb = Tab Box();
));
tb << Set OverFlow Enabled(0);
insert into(main,tb);
);
For( j = 1, j <= N Items( stepname ), j++,
for(k=1, k<=nitems(step_aa[steps[j]]), k++,
main[j] << Add (EvalInsert("Data Table(\!"Specname=^step_aa[steps[j]][k]^\!")"))
); // add for k
main[j] << set selected(1); //select the first tab
);
display << set selected(1);

Sin embargo, creo que una mejor opción es utilizar un árbol con TreeNodes. A continuación se muestra un ejemplo y la visualización resultante.
Names Default to Here(1);
steps= {"A", "B", "C", "D"};
step_aa = Associative Array(steps);
step_aa["A"] = {"1101", "1102", "1103", "1104"};
step_aa["B"] = {"2101", "2102", "2207", "2068", "270X"};
step_aa["C"] = {"37Z0", "3027", "3133"};
step_aa["D"] = {"4001", "4005", "4517"};
roots = {};
For( j = 1, j <= N Items( steps ), j++,
root = TreeNode(stepname[j]);
insert into(roots, root);
);
For( j = 1, j <= N Items( steps ), j++,
For(k =1, k<=nitems(step_aa[steps[j]]), k++,
c = Tree Node( step_aa[steps[j]][k] );
roots[j] << Append(c);
);
);
New Window( "TreeBox Tests",
HListBox(
tree = Tree Box( roots, Size( 300, 200 ) ),
tb = TextBox()
)
);
tree << Set Node Select Script(
Function( {thistree, thisnode},
If( !Is Empty( thisnode ),
txt = thisnode << get label;
tb << set text ( EvalInsert("Data Table(\!"Specname=^txt^\!")") )
)
)
);