Choose Language Hide Translation Bar
Highlighted
merwanmok
Level I

Upgrade on JMP version 15 : Display box and column list issues

Hi all,

 

I am very confused with the new version of JMP (15) because I have a script from the previous version that is not working anymore. I think this is related to display boxes and list of columns, but I am not completely sure.

 

The goal of my script below (and also attached) is to calculate drifts of parameters (column "parameter" for example) in function of column "time" from the data table "table test" attached.

The problem is that I have an error message when I execute the script and choose the corresponding data table. I don't really understand why. In first approach; I think this is related to display boxes and the fact I use a list of column and not a single character or numerical value but I don't know how to proceed to correct the problem.

If someone has the same issue or has an idea on how to proceed I would be very grateful.

 

Thank you in advance !

 

Merwanmok

 

Delete Globals();
Delete Symbols();
dt_old = Open();
init_dlg = New Window( <<modal,
	H List Box(
		Panel Box( "Colonnes",
			colListData = Col List Box( All, width( 100 ), nLines( 10 ) )
		),
		V List Box(
			Panel Box( "Colonne(s) choisie(s)",
				Lineup Box( N Col( 2 ), Spacing( 3 ),
					Button Box( "Paramètre",
						it << Append( colListData << GetSelected )
					),
					it = Col List Box(
						width( 200 ),
						nLines( 5 ),
						MinCol( 1 ),
						Numeric
					)
				)
			),
			Panel Box( "Colonne \!"temps\!"",
				H List Box(
					Lineup Box( N Col( 2 ), Spacing( 3 ),
						Button Box( "Temps",
							tem << Append( colListData << GetSelected )
						),
						tem = Col List Box( width( 200 ), nLines( 5 ), MinCol( 1 ) )
					),
					V List Box(
						Text Box(
							"Nom de la première étape (facultatif si \!"M00\!" ou 0 : "
						),
						nom = Text Edit Box( 1.1 )
					)
				)
			),
			V List Box(
				Text Box( "Création nouvelle table" ),
				New = Radio Box( {"Non", "Oui"} )
			),
			V List Box(
				Text Box( "Type de dérive" ),
				typ = Radio Box( {"%", "pm", "unité de la colonne choisie "} ),
				Unit_ = Text Edit Box( "unité" ),
				Text Box(
					"ATTENTION : Le choix ''pm'' correspond à des données d'origine en :"
				),
				origi = Radio Box( {"nm", "µm"} )
			)
		)
	)
);
If( New << get == 2,
	dt = dt_old << Sort(
		By( SN ),
		Order( Ascending ),
		Output Table Name( "ALLNew" )
	),
	dt = dt_old
);
list_col = dt << get column names( string );
dt << Select Excluded;
dt << unexclude;
dt << Clear Select;
dt << Select Hidden;
dt << unhide;
dt << Clear Select;
m = {};
tempo = 1;
For( x = 1, x < N Rows(), x++,
	If( Char( Column( dt, Eval( tem << Getitems ) )[x] ) == nom << get text,
		Insert Into( m, x - tempo );
		tempo = x;
	)
);
If( m == {},
	For( x = 1, x < N Rows(), x++,
		If( Char( Column( dt, Eval( tem << Getitems ) )[x] ) == "M00",
			Insert Into( m, x - tempo );
			tempo = x;
		)
	)
);
If( m == {},
	For( x = 1, x < N Rows(), x++,
		If( Num( Column( dt, Eval( tem << Getitems ) )[x] ) == 0,
			Insert Into( m, x - tempo );
			tempo = x;
		)
	)
);
Insert Into( m, N Rows() - tempo + 1 );
For( h = 1, h < Length( Eval( it << GetItems ) ) + 1, h++,
	I = Column( dt, Eval( it << GetItems )[h] );
	di = "D" || Eval( it << GetItems )[h] || If(
		typ << get == 1, " (%)",
		typ << get == 2, " (pm)",
		" (" || Eval( Unit_ << get text ) || ")"
	);
	If( !Contains( list_col, di ) == 1,
		D = New Column( di, Numeric, Continuous, Format( "Best", 12 ) ),
		D = Column( dt, di )
	);
	If(
		typ << get == 1,
			o = 0;
			For( k = 1, k < N Rows(), k += m[o],
				o++;
				For( q = k, q < k + m[o], q++,
					D[q] = ((I[q] - I[k]) / I[k]) * 100
				);
			);,
		typ << get == 2,
			If( origi << get == 1,
				o = 0;
				For( k = 1, k < N Rows(), k += m[o],
					o++;
					For( q = k, q < k + m[o], q++,
						D[q] = I[q] * 10 ^ 3 - I[k] * 10 ^ 3
					);
				);
			,
				o = 0;
				For( k = 1, k < N Rows(), k += m[o],
					o++;
					For( q = k, q < k + m[o], q++,
						D[q] = I[q] * 10 ^ 6 - I[k] * 10 ^ 6
					);
				);
			),
		o = 0;
		For( k = 1, k < N Rows(), k += m[o],
			o++;
			For( q = k, q < k + m[o], q++,
				D[q] = I[q] - I[k]
			);
		);
	);
);
13 REPLIES 13
Highlighted

Re: Upgrade on JMP version 15 : Display box and column list issues

Why do you think that the problem is related to a display box or a list of columns?

 

What error message do you get? Where does the error occur?

 

Have you tried to evaluated small portions of the script from the top to confirm where the script is working? Have you used the Debugger to step through the script?

 

It is helpful if we do not have to start from the beginning.

Learn it once, use it forever!
Highlighted
merwanmok
Level I

Re: Upgrade on JMP version 15 : Display box and column list issues

Thank you for your answer.

 

Why do you think that the problem is related to a display box or a list of columns?

 

Because I already used the debugger to step through the script and the error message that I get is related to display box. I also looked at other discussions and there is an issue with the new JMP version getting parameters from "New window <<modal". I think with the new version we need to call the "get" directely inside the "new window" call and not after, but in my case on of my parameters "tem" is a list of column so I don't know how to proceed.

 

What error message do you get? Where does the error occur?

 

You can find attached the error message. Sorry it is in french. It occurs inside the new window call at this levelI think :

tem = Col List Box( width( 200 ), nLines( 5 ), MinCol( 1 ) )

Have you tried to evaluated small portions of the script from the top to confirm where the script is working?

 

Yes but my script is starting with the "new window"...

 

Have you used the Debugger to step through the script?

 

Yes I used the debugger and this is how I understood that it was linked to display box and column list inside.

 

 

Thank you for your help !

 

 

Highlighted

Re: Upgrade on JMP version 15 : Display box and column list issues

The error seems to be about the Glue() function called in the line that delete global variables and opens a data table. The New Window() function expects a character string as the first argument to be used as the window title.

 

I think that the use of the << Append() message is unnecessary because you are creating the new window entirely with the New Window() function call. The message is useful to add to an existing window after it is created.

Learn it once, use it forever!
Highlighted
merwanmok
Level I

Re: Upgrade on JMP version 15 : Display box and column list issues

Thank you for your answer.

 

I deleted the lines with << Append() function and also Delete Globals() function at the begining but I still have the error message..

Highlighted

Re: Upgrade on JMP version 15 : Display box and column list issues

Did you insert a character string with the window title as the first argument to New Window() function?

Learn it once, use it forever!
Highlighted
merwanmok
Level I

Re: Upgrade on JMP version 15 : Display box and column list issues

No the first argument of the new window is <<modal, then the new window function start directely with a H List Box.

Highlighted

Re: Upgrade on JMP version 15 : Display box and column list issues

Please insert a character string for the window title as the first argument as I suggested and see what happens to the error.

Learn it once, use it forever!
Highlighted
merwanmok
Level I

Re: Upgrade on JMP version 15 : Display box and column list issues

I changed the fourth line as :

 

init_dlg = New Window("Interface", <<modal,

My window opens, I select my parameters and then I still have the same error message, so no changes

 

 

Highlighted

Re: Upgrade on JMP version 15 : Display box and column list issues

It looks like you are trying to use the display boxes after the dialog has been dismissed.  Here is a small example similar to what you are doing:

 

// This example works in JMP 14 on Windows, but will fail on Mac
w = New Window("fails in JMP 15", <<Modal,
	x=Number Edit Box(42)
);
// If you add this statement, it will also fail in JMP 14 on Windows
// Wait(0);
if (w["Button"] == 1,
	New Window("result", Text Box("value entered was " || Char(x<<Get)));
	,
	New Window("cancelled", Text Box("Dialog was cancelled"));
);

Display boxes are "owned" by the window that they are in, and will go away when the window closes.  On Windows this may have worked in JMP 14, but note from the Wait(0) comment that even Windows can fail with this type of usage.  Eventually the boxes get deleted, you just don't know when.

 

This example will work in both JMP 14 and JMP 15 on both Mac and Windows.  Using this structure should make your dialog work:

 

// This example works in JMP 14 or 15 on Mac or Windows
// Results will be returned with the modal status
Names Default To Here(1);
w = New Window("works in JMP 15",
	<<Modal, <<Return Result,
	x=Number Edit Box(42)
);
if (w["Button"] == 1,
	New Window("result", Text Box("value entered was " || Char(w["x"])));
	,
	New Window("cancelled", Text Box("Dialog was cancelled"));
);
Article Labels

    There are no labels assigned to this post.