cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
0 Kudos

dt << Delete Table Variables()

What inspired this wish list request? Please describe the current issue that needs improvement or the problem to be solved that is not easy or possible right now, with an example use case. 

There is an option in JSL to delete table scripts (plural) but not for deleting table variables. Please make this function plural as well, and accept either a single variable or an array.

 

What is the improvement you would like to see? Please describe the idea for improving JMP. Please include mock-ups, wireframes, screenshots, scripts, other documents or examples from other software that help describe the change you would like to see. 

Add function in JSL for "dt << Delete Table Variables()"

 

Why is this idea important? Please describe the value to you and/or other users if the idea is implemented (for example, ease of use, must have,…).

Standardize JSL functions to improve software development speed, readability, and quality.

 

1 Comment
hogi
Level XI

While waiting for Kudos, you could use this script - maybe add it to a toolbar or link it to a Keybord Shortcut ...

Names Default To Here( 1 );

remove Table Variables = Function( {},
	{default local},
	dt = Current Data Table();
	dt << copy table script( "no data" );
	tableScript = Eval( Eval Expr( Parse( Expr( Get Clipboard() ) ) ) );

	tableScriptList = Substitute( Name Expr( tableScript ), Expr( New Table() ), Expr( List() ) );
	tableVariables = Filter Each( {part}, tableScriptList, Head( Part ) == Expr( New Table Variable() ) );
	tableVariableNames = Transform Each( {part}, tableVariables, Arg( part, 1 ) );
	For Each( {variable}, tableVariableNames, dt << Delete Table Variable( variable ) );
);

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Table Variable( "x", 5 );
dt << New Table Variable( "text", "hello" );

remove Table Variables();