I have the following JSL code for assigning tags to a group of columns...
t1 = "Contaminants";
dt5 << Define Tag( t1, Color("Light Red") );
Data Table(dt5):CH4.ppm. <<
Set Property( Tags, {"Contaminants"} ),;
Data Table( dt5 ):CO2.ppm. <<
Set Property( Tags, {"Contaminants"} );
Data Table( dt5 ):H2O.per. <<
Set Property( Tags, {"Contaminants"} );
Data Table( dt5 ):CO.ppm. <<
Set Property( Tags, {"Contaminants"} );
Data Table( dt5 ):O3.ppb. <<
Set Property( Tags, {"Contaminants"} );
Data Table( dt5 ):NO2.ppb. <<
Set Property( Tags, {"Contaminants"} );
Data Table( dt5 ):NO.ppb. <<
Set Property( Tags, {"Contaminants"} );
It works fine but I'm wondering if there is a way to make this more efficient by eliminating the duplicate Data Table/Set Property functions. Is there a way to define a list of columns in the original Data Table command? I have tried defining a list with curly braces, parentheses, both curly braces and parentheses, with colons, without colons, etc, etc and I can't seem to hit on the right syntax. The scripting index doesn't seem to help here.
Also, I would like to define the name of the tag as a variable (t1). This seems to work for the Define Tag function but I can't seem to get it to work for the multiple Set Property functions.
Does anyone have insight here as to what I'm missing?
Thanks much.