To add a new column to a data table, send a New Column message to a data table reference or use the New Column() function. The first argument, the column’s name, is required. Either enclose the name in quotation marks or specify an expression evaluating to the name.
a = "wafer";
dt << New Column( a );
If the table already includes a column by the same name, a sequential numeric value is appended to the new column name (wafer, wafer 2, wafer 3, and so on).
To fill the column with data, use Values or its equivalent, Set Values. Include the value for each cell in a list.
The column can also be filled with numeric values. The following example adds a new column called Row Number to a new data table. The function N Row returns the number of rows in the table, and numeric values populate all of the rows in the column, beginning with 1.
New Column() can also be used as a built-in function, in other words, without the << (Send) command applied to the data table reference. When used in this way, the column is added to the current data table.