cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
hogi
Level XII

Oops - I lost my data ...

3 ACCEPTED SOLUTIONS

Accepted Solutions
hogi
Level XII

Re: Oops - I lost my data ...

option 1):
add a Link with a non-resolved reference:

 

Names Default to Here(1);

testMode= 1;
dt =  Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << new column("Conan the Destroyer",Set Property("Link Reference", {Reference Table(link_path), Options("Use Linked Column Name", "Auto Open")}));

dt << save("$TEMP/test.jmp");
close(dt, noSave);

open("$TEMP/test.jmp");  

View solution in original post

hogi
Level XII

Re: How to make a data table non-accessible?

The good thing:
JMP stores the Table reference in plain text ...

By deleting the ", Auto Open" one can revive the file:

hogi_0-1733159175285.png

JMP will show a warning message:

hogi_1-1733159536529.png

and skip the details of the erroneous column.

View solution in original post

Re: Oops - I lost my data ...

I believe understand the problem after speaking with another colleague.

 

The issue here is the JMP user interface will not allow one to save a table, with Auto Open selected, while an invalid Link Reference path exists. The JMP UI will save the table but will set the Auto Open option. So the table can be opened or recovered.

 

In JSL however, it is permitted. The table is saved with Auto Open and an invalid Link Reference. This prevents JMP from opening the table. The JMP UI has some sort of safety check in place that is not built into JSL. 

 

I've reported this issue so it can be addressed in a future release.

 

Best!

View solution in original post

10 REPLIES 10
hogi
Level XII

Re: Oops - I lost my data ...

option 1):
add a Link with a non-resolved reference:

 

Names Default to Here(1);

testMode= 1;
dt =  Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << new column("Conan the Destroyer",Set Property("Link Reference", {Reference Table(link_path), Options("Use Linked Column Name", "Auto Open")}));

dt << save("$TEMP/test.jmp");
close(dt, noSave);

open("$TEMP/test.jmp");  

Re: Oops - I lost my data ...

I believe understand the problem after speaking with another colleague.

 

The issue here is the JMP user interface will not allow one to save a table, with Auto Open selected, while an invalid Link Reference path exists. The JMP UI will save the table but will set the Auto Open option. So the table can be opened or recovered.

 

In JSL however, it is permitted. The table is saved with Auto Open and an invalid Link Reference. This prevents JMP from opening the table. The JMP UI has some sort of safety check in place that is not built into JSL. 

 

I've reported this issue so it can be addressed in a future release.

 

Best!

hogi
Level XII

Re: Oops - I lost my data ...

Hi @Dahlia_Watkins , thank you for digging deeper and triggering a bugfix for a future release : )

[TS - 00177463]

jthi
Super User

Re: How to make a data table non-accessible?

In what sense non-accessible?

-Jarmo
hogi
Level XII

Re: How to make a data table non-accessible?

In the sense of "dead".

hogi
Level XII

Re: How to make a data table non-accessible?

The good thing:
JMP stores the Table reference in plain text ...

By deleting the ", Auto Open" one can revive the file:

hogi_0-1733159175285.png

JMP will show a warning message:

hogi_1-1733159536529.png

and skip the details of the erroneous column.

txnelson
Super User

Re: How to make a data table non-accessible?

What is the purpose of this thread?

Jim
hogi
Level XII

Re: How to make a data table non-accessible?


@txnelson wrote:

What is the purpose of this thread?



mainly: Help people save their work.

 

Besides that:
a) Documentation: Things you should NOT (!!) do with your data table.

b) Motivation:
@ colleagues - please invest 30 minutes to understand the beauty of Eval/Eval Expr/Expr
(the basics: # 62, some examples: #66)  ---  it will save you from lost data like this one.

c) preventive action:

-> I will add a check + warning functionality to the hogi_0-1733168619557.png button ...
if a variable is defined in the script - and the variable shows up in a message (<<  ...) ... show a WARNING !

 

hogi
Level XII

Re: How to make a data table non-accessible?


@hogi wrote:
a check + warning functionality  ...

 


 

 

myscript = Parse( Current Window()[Script Box( 1 )] << get text );
variables = {};
// find the assignments and collect the JSL variables
assigns = Extract Expr All Matches(
	Name Expr( myscript ),
	Expr( Assign( Wild List() ) )
);
For Each( {item}, assigns, Insert Into( variables, Arg( item, 1 ) ) );
// collect the messages
messages = Extract Expr All Matches(
	Name Expr( myscript ),
	Expr(
		Send( Wild(), Wild List() )
	)
);
For Each( {message}, messages, 
// bother an experienced user just when he forgot to use Expr:
	// assuming there is a surrounding Eval (Eval Expr()),  remove all the Expr() - including the content [dirty]
	Extract Expr All Matches(
		Arg( Name Expr( message ), 2 ),
		Expr( Expr( Wild List() ) )
	);  // returns: cleanedExpr, without the Expr()s
	//search for variables
	For Each( {variable, idx}, variables,
		If(
			Not(
				Is Empty(
					Eval(
						Eval Expr(
							Extract Expr(
								Expr(
									Name Expr( cleanedExpr )
								),
								Expr( Name Expr( variable ) )
							)
						)
					)
				)
			),
			Caption(
				Char( variables[idx] ) || " found in a message to " ||
				Char( Arg( Name Expr( message ), 1 ) ) ||
				".\!n Please correct it with Eval(Eval Expr( ... Expr()))"
			);
			Stop();
		)

	
	
	);
);
	
	
//Extract Expr All Matches?
// it works like Extract Expr, but doesn't stop after the first match. 
// saves the "cleaned" expression as cleanedExpr