Scripting Guide > Data Tables > Basic Data Table Scripting > Prevent Changes to a Data Table
发布日期: 11/15/2021

Prevent Changes to a Data Table

To prevent any changes to the data table (such as changing column names, changing the data type, deleting rows, and so on), use Lock Data(1).

dt << Lock Data Table( 1 );

To prevent modifying adding or deleting columns and rows and modifying cells, use Set Edit Lock:

dt << Set Edit Lock( "Add Columns" );
dt << Set Edit Lock( "Delete Columns" );
dt << Set Edit Lock( "Add Rows" );
dt << Set Edit Lock( "Delete Rows" );
dt << Set Edit Lock( "Modify Cells" );

To get a list of data table operations that are locked, use Get Edit Lock:

dt << Get Edit Lock();

{"Modify Cells", "Add Rows", "Delete Rows", "Add Columns", "Delete Columns"}

To allow a specific data table operation again, use Clear Edit Lock:

dt << Clear Edit Lock( "Modify Cells" );
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).