cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
MuttonChops
Level III

For Loop inside a tab box where each loop creates a different tab in the window

I'm attempting to loop through a variable list of tools (ChamberTool or Cham) to create a list.  Then using that list I create a contour of the data by date where each chamber is a separate tab on a tab box window.  I've done each of these things independently but my particular issue is creating a tab for each tool from this variable list.  Maybe my approach is way off but here is my script.  

 

First, here are the two bits of script I have that work.  I hand wave over the scripting of the parts that I already know how to do and to keep this post more brief and not detract from my main problem statement.

ContourG = dt << Contour stuff here;

Graph = new window("Contours", tab box(
		"Tab Name Here", (vlistbox(ContourG)),
));

But when i try to run a for loop i am completely broken.

Cham = Associative Array(Column(dt_stacked, "Chamber") << Get Values) << Get Keys;Associative Array(Column(dt_stacked, "Chamber")<< Get Values)<<Get Keys;

Graph = new window("Contours", tab box(
	For (x=1, x<=nitems(Cham), x++,
		ChamberTool= Cham[x];
		G_Contour = Cham[x];
		ContourG = dt_stacked << Contour Plot(
			X( :XLoc, :YLoc ),	Y( :Thickness ),
			Where( :Chamber == ChamberTool ),	By(:Date),
			Chart Parameter stuff here,	SendToReport( other stuff here)	),
		ChamberTool, (vlistbox(ContourG)),
)));
11 REPLIES 11
jietan25
Level II

Re: For Loop inside a tab box where each loop creates a different tab in the window

Thanks for the input. My report will generate about 8-10 charts per feature, chart type will be different by type of feature, there are 3-8 features per layer, and  up to 10 layers per product, products could be varies depends on days of data pull.  Is that possible to store all plots/charts in a list or array for easier access thru FOR LOOP?   

txnelson
Super User

Re: For Loop inside a tab box where each loop creates a different tab in the window

Here is a script that generates prebuilt analyses in one window, and a second window dynamically genrates the displays in real time.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
// Create the default lists
namesList = {};
objList = {};
// Generate the output names
For( i = 1, i <= 10, i++,
	Insert Into( namesList, "Analysis " || Char( i ) )
);

//Pre run the reports
For( i = 1, i <= 10, i++,
	objList[i] = V List Box( Oneway( x( :Site ), y( Column( i + 4 ) ) ) )
);

// Create the display window for to display the prebuilt reports upon a user's reques
nw = New Window( "Output PreBuilt",
	theHLB = H List Box(
		lB = List Box(
			namesList,
			maxselected( 1 ),
			Try( myObj << delete );
			theHLB << append( myObj = objList[Contains( namesList, (lB << get selected)[1] )] << clone box );
		)
	)
);

// Create the display window for the displaying of the dynamically created reports
nw2 = New Window( "Output Dynamic Creation",
	theHLB2 = H List Box(
		lB2 = List Box(
			namesList,
			maxselected( 1 ),
			Try( myObj2 << delete );
			theHLB2 << append(
				myObj2 = V List Box(
					Oneway( x( :Site ), y( Column( Contains( namesList, (lB2 << get selected)[1] )+4 ) ) )
				)
			);
		)
	)
);
Jim