Set Operations for Lists of DisplayBoxes?How to apply set operations to lists of display boxes?
- remove duplicates
- intersect
- subtract
Plan B:
Is there a function which returns the unique position of a display box in the display tree?
With the information about the position (pos 1.2.4.1.2 vs. 1.2) one could pre-execute the set operations for positions and the apply it to the lists with display boxes.
I found
Get Display Path( )
which gives the Xpath or subscript function to get from one Level to another level. But I didn't find a function Get Pos ...
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Variables( X( :height ), Y( :weight ), Overlay( :sex ) )
);
gb2 = gb << Clone box();
nw = New Window("test",H List Box (gb2,gb2));
(nw << xpath("//AxisBox")) << parent;Automation and ScriptingRe: Set Operations for Lists of DisplayBoxes?If you have a list of references and a reference you wish to find you can use Contains
Names Default To Here(1);
nw = new window("",
vlb = v list box()
);
tb1 = Text Box("a");
tb2 = Text Box("b");
tb3 = Text Box("c");
vlb << Append(tb1);
vlb << Append(tb3);
vlb << Append(tb2);
Contains(vlb << XPath("//TextBox"), tb2); //3Re: Set Operations for Lists of DisplayBoxes?ah, right, so all the functions work 
- even the associative array.
very useful, thanks 
Hm, strange - seems that when I tried it first I did something wrong ...
Names Default To Here(1);
nw = new window("",
vlb = v list box(vlb2 = v list box());
);
tb1 = Text Box("a");
tb2 = Text Box("b");
tb3 = Text Box("c");
vlb << Append(tb1);
vlb << Append(tb2);
vlb2 << Append(tb3);
aa1 = associative array((vlb << XPath("//TextBox"))<< parent);
aa2 = associative array((vlb2 << XPath("//TextBox"))<< parent);
aa1 << intersect(aa2);
show(aa1)