Scripting Guide > Display Trees > Construct Custom Windows > Counting the Number of Child Boxes
发布日期: 04/13/2021

Counting the Number of Child Boxes

Suppose that you want to count the number of child text boxes in a list box. The most reliable way is to use XPath to find a specific string in the text boxes and then use N Items() to count the number of text boxes.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = Bivariate(
	Y( :weight ),
	X( :height ),
	Group By( :age ),
	Fit Line( {Line Width( 3 )} )
);
 

/* start with the root list box, find a text edit box

that starts with “Linear Fit age==”, and count the number of children */

N Items( biv << XPath( "//ListBox[starts-with(TextEditBox,'Linear Fit age==')]" ) );
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).