Subscribe Bookmark RSS Feed

Clear Column Contents Message

djhanson

Community Trekker

Joined:

Jun 23, 2011

Besides looping thru a column's rows, does JSL happen to have a column message to clear/delete a column's contents?  just curious... thx, dj

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

No dedicated "delete content" command that I am aware of. However <<Set Each Value() can be used as such a message. Another option is Main Menu("Delete"), but I do not recommend that unless one has 100% control over what is selected in the current data table (it may in some circumstances even delete the code in the script editor rather than the column content).

Names Default To Here( 1 );

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

// A simple way to do it

Column( "age" ) << set each value( Empty() );

Column( "name" ) << set each value( Empty() );

// Another, more risky, way to do it

dt << select all rows;

Column( "sex" ) << setselected( 1 );

Main Menu( "Delete" );

1 REPLY
Solution

No dedicated "delete content" command that I am aware of. However <<Set Each Value() can be used as such a message. Another option is Main Menu("Delete"), but I do not recommend that unless one has 100% control over what is selected in the current data table (it may in some circumstances even delete the code in the script editor rather than the column content).

Names Default To Here( 1 );

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

// A simple way to do it

Column( "age" ) << set each value( Empty() );

Column( "name" ) << set each value( Empty() );

// Another, more risky, way to do it

dt << select all rows;

Column( "sex" ) << setselected( 1 );

Main Menu( "Delete" );