Subscribe Bookmark RSS Feed

A JSL script for moving columns to original order?

claude_bellavan

Community Trekker

Joined:

Nov 5, 2014

Hello,

Is there a way to script this menu command: Columns/Reorder Columns/Original Order .

In the JSL manual, I found :

  • dt<<Reorder By Name
  • dt<<Reorder By Data Type
  • dt<<Reorder By Modeling Type

In need to restore the column order to orignal order before Data Table update and reorder it by name after the update.

Thanks,

Claude B.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

It's simply

dt << Original Order;


4 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

It's unusual to have a menu command without a JSL equivalent. But if it's not there (I didn't check), you can make use of 'MainMenu()':

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

Wait(3);

dt << ReorderByName;

Wait(3);

dt = CurrentDataTable();

MainMenu("Cols:Reorder Columns:Original Order");


Solution

It's simply

dt << Original Order;


ian_jmp

Staff

Joined:

Jun 23, 2011

The best place to check out this kind of stuff is 'Help > Scripting Index', which usually has useful examples too, should you need them:

10601_Screen Shot 2015-12-07 at 08.49.27.png

Clearly I need to use it more often myself . . .

claude_bellavan

Community Trekker

Joined:

Nov 5, 2014

Thank you very much!

Both responses will be very useful in the future.

Claude