My mistake, try this method. I don't like using this Eval(Parse()) methodology, but it was the only way I could make it work.
The code creates a character string that contains the JSL required to create the new column, and then runs the JSL
Names Default To Here( 1 );
dt = Current Data Table();
colNames = dt << get column names( string );
// Build a list of the columns to be evaluated
theCols = "";
For Each( {col}, colNames,
If( Contains( col, "volt" ) & Contains( col, "grp1" ),
theCols = theCols || ", :" || col
)
);
// Create the new column and formula command, adding in the list of
// columns ceated in the above loop and then executing it
Eval(
Parse(
"dt << new column(\!"max_volt_grp1\!",formula(Max(" ||
Substr( theCols, 2 ) || ")));"
)
);
Jim