Normally when using Tags I just want to add it to a column. Adding one like this, however ...
dtTag:my_column << Set Property( Tags, {"New Tag"} );
... will overwrite any existing tags that the column already has. Is there a way to easily add a tag in JSL in a way that does not remove any existing tags? I could first get column tags and then modify the list of tags I assign, but want to know if there is a simpler way.
There's no built-in way I can find to simply add a tag. I would just define a function for it.
Names Default To Here( 1 );
add_tag = Function( {col, tag_name, this_dt = Current Data Table()},
og_tags = Column( this_dt, col ) << Get Property( "Tags" );
Column( this_dt, col ) << Set Property( "Tags", Eval( If( Is Empty( og_tags ), {}, og_tags ) || Eval List( {tag_name} ) ) );
);
//demo
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
add_tag( "name", "cheeses", dt );
Wait( 1 );
add_tag( "name", "weirdness" );
Show( dt:name << Get Property( "Tags" ) ); //dt:name << Get Property("Tags") = {"cheeses", "weirdness"};
<BR />