Here is one way to do what you want. My example shows a hard coded way to solve the problem, and also a more generic method
Names Default To Here( 1 );
// Script to create the required column when the names of the columns are known
dt = New Table( "Example 1",
New Column( "A", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 1, 2] ) ),
New Column( "B", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2, 2, 5] ) ),
New Column( "C", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [100, 200, 300] ) ),
New Column( "D", Character, Nominal, Formula( "A = " || Char( :A ) || ": B = " || Char( :B ) || ": C = " || Char( :C ) ) )
);
// Example where script examines the data table and from it, generates the new column
dt2 = New Table( "Example 2",
New Column( "A", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 1, 2] ) ),
New Column( "B", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2, 2, 5] ) ),
New Column( "C", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [100, 200, 300] ) )
);
colNames = dt2 << get column names( string );
// Build the formula in a string variable
theCMD = "dt2 << New Column( \!"D\!", character, Nominal, formula(";
For Each( {col, index}, colNames,
If( index == 1,
theCMD = theCMD || "\!" " || col,
theCMD = theCMD || "\!" : " || col
);
theCMD = theCMD || " = \!" || Char( :" || col || ") || ";
);
theCMD = theCMD || "));";
Eval( Parse( theCMD ) );
Jim