cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

Get the reference of a window

Elise_B
Level III

Hello,

I want to be able to delete a box when closing a data table. 

In the code below I want to close Big Class, the text Box of w to be deleted. 

 

Names Default To Here( 1 );
project = New Project();

project << Append(
 w = New Window( "Window", Text Box( "Window 1" ) )
);
project << Append(
 w2 = New Window( "Window2", Text Box( "Window 2" ) )
);

dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt1 << On Close(
 w["Window 1 ?"] << Delete;
);

My problem is that when I close BigClass, jmp shows me "unresolved name for w". Is it possible to recover the reference of the window w which seems to be lost after opening the data table. 

 

Thank you in advance for your answers

This post originally written in French and has been translated for your convenience. When you reply, it will also be translated back to French .

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User


Re: Obtenir la référence d'une fenêtre

Accessing the window to close based upon using the Window() function with the window's name worked for me

Names Default To Here( 1 );
project = New Project();

project << Append(
 w = New Window( "Window", Text Box( "Window 1" ) )
);
project << Append(
 w2 = New Window( "Window2", Text Box( "Window 2" ) )
);

dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt1 << On Close(
 window("Window") << Delete;
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User


Re: Obtenir la référence d'une fenêtre

Accessing the window to close based upon using the Window() function with the window's name worked for me

Names Default To Here( 1 );
project = New Project();

project << Append(
 w = New Window( "Window", Text Box( "Window 1" ) )
);
project << Append(
 w2 = New Window( "Window2", Text Box( "Window 2" ) )
);

dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt1 << On Close(
 window("Window") << Delete;
);
Jim
Elise_B
Level III

Re: Obtenir la référence d'une fenêtre

Merci beaucoup cela a fonctionné parfaitement !

Elise B.