BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Highlighted
jietan25

Not applicable

Joined:

Feb 25, 2019

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

Joined:

Jun 22, 2012

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